Docker Update Permissions

Samson OladipoSamson Oladipo
1 min read

Task Requirement :

In one of our projects, developers need access to run docker commands on App Server 3. This user is already created on the server. Accomplish this task as per the details given below:

User rose is not able to run docker commands on App Server 3 in the Datacenter, make the required changes so that this user can run docker commands without sudo.

Execution :

To grant a user in this case, rose the ability to run Docker commands without using sudo, you need to add the user to the docker group. The docker group is automatically created when you install Docker on a system and is used to manage access to the Docker daemon.

First things first, connect to App Server 3. Also, consider performing this task with a user with administrative privileges (user with sudo rights).

  • Connect to the App Server 3 and add user rose to the docker group.

    sudo usermod -aG docker rose

  • Switch the user to rose to verify/test the docker command without sudo.

    sudo su rose

    docker run hello-world

7
Subscribe to my newsletter

Read articles from Samson Oladipo directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Samson Oladipo
Samson Oladipo

DevOps enthusiast sharing real-world insights. ๐Ÿš€ #Automation #CI/CD #InfrastructureAsCode