0

I am learning penetration testing, and I am trying to perform linux privilege escalation using docker. So I created a new user with the minimum permissions and I added it to the docker group. The problem now is that this new user cannot run docker.

I tried to change the permission for this user using chmod but it does not work. Can anyone help me please to permit the new user to run docker!! this is the new user:

pentester:x:1001:1001::/home/pentester:/bin/bash

and this is the docker group:

docker:x:976:anasgharsa,pentester

and when I am connected with the new user and try docker images or docker ps I get this error message : "unable to get absolute bin path: stat .: permission denied"

CC BY-SA 4.0

1 Answer 1

0

It seems like user doesn't have the necessary permissions to run Docker. I hope that you have included your user "pentester" in the following way: sudo usermod -aG docker pentester

First confirm that user is a member of the "docker" group, you can run the following command as the root user: grep '^docker:' /etc/group

If not then add the user by executing following command: sudo usermod -aG docker pentester

Confirm the user's membership in the "docker" group by executing the following command: groups pentester

Restart the docker services by the following command: sudo service docker restart

Start a new shell session.

CC BY-SA 4.0
2
  • First of all, thank you for your reply, second, yes I did include pentester to the docker group using "sudo usermod -aG docker pentester" and then I restarted the docker service but still cannot run docker and that's why I posted my question here trying to find some answers.when I execute the command "grep '^docker:' /etc/group" I get this "docker:x:976:anasgharsa,pentester", even "groups pentester" this is what I get "pentester : pentester docker". I searched everywhere to find how can pentester run docker but I find that I need to add him to the docker group but he is already in the group Commented Sep 2, 2023 at 10:10
  • no one can tell me how to resolve this problem?? is it that hard ?' should I give up already ? Commented Sep 3, 2023 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.