cancel
Showing results for 
Search instead for 
Did you mean: 
  • 1,709 Views

Ch.13 Lab question

Jump to solution

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

1 Solution

Accepted Solutions
pjentw
Mission Specialist
Mission Specialist
  • 1,691 Views

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?

 

View solution in original post

3 Replies
pjentw
Mission Specialist
Mission Specialist
  • 1,692 Views

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?

 

  • 1,686 Views

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

pjentw
Mission Specialist
Mission Specialist
  • 1,677 Views

Exactly that - spot on!

0 Kudos
Join the discussion
You must log in to join this conversation.