Hi, does anyone know why in the Ch.13 end of lab exercise the instructor in the vid ran a "chmod 777" command on a directory and the written solution used this i think ?
"podman exec -it db_01 grep mysql /etc/passwd"
I think the question asked .."and configure the directory so that containers have read/write access"
Thank you.
-Angelo
Hi Angelo,
That command would print out the UID for the mysql user within the container:
[podsvc@serverb ~]$ podman exec -it db_01 grep mysql /etc/passwd
mysql:x:27:27:MySQL Server:/var/lib/mysql:/sbin/nologin
Which in this case is 27, along with the group ID. The instructor does the chmod 777 /home/podsvc/db_data command so that ALL users and groups have read, write and execute access.
The guide does it more specifically and only allows the mysql user access:
[podsvc@serverb ~]$ podman unshare chown 27:27 /home/podsvc/db_data
They both acheive a similar goal, it's just the guide uses a more specific podman command to allow access to the container for that folder, rather than opening access to all users on the host.
Hope that helps?
Hi Angelo,
That command would print out the UID for the mysql user within the container:
[podsvc@serverb ~]$ podman exec -it db_01 grep mysql /etc/passwd
mysql:x:27:27:MySQL Server:/var/lib/mysql:/sbin/nologin
Which in this case is 27, along with the group ID. The instructor does the chmod 777 /home/podsvc/db_data command so that ALL users and groups have read, write and execute access.
The guide does it more specifically and only allows the mysql user access:
[podsvc@serverb ~]$ podman unshare chown 27:27 /home/podsvc/db_data
They both acheive a similar goal, it's just the guide uses a more specific podman command to allow access to the container for that folder, rather than opening access to all users on the host.
Hope that helps?
Hi, thank you for the clarification.
I now think the guide showed how to allow user "mysql" access to the container, and the vid showed how to allow ALL users which include the "mysql" user access to the container.
Sincerely,
-Angelo
Exactly that - spot on!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.