1

I added my account to docker group.

joont@joont-ubuntu:~$ sudo gpasswd -a joont docker

and I typed id to check my account was added.

joont@joont-ununtu:~$ id
uid=1000(joont) gid=1000(joont) groups=1000(joont),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare)

As you see, it doesn't applied.
But when I typed id $USER, result was different.

joont@joont-ununtu:~$ id joont
uid=1000(joont) gid=1000(joont) groups=1000(joont),999(docker)

Why they're different?

And now I still can't run docker command without sudo.

joont@joont-ununtu:~$ docker container ls
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied
  • 2
    Did you remember to logout/login after adding a group? – user535733 Apr 21 at 14:57
  • To start with, which version of Linux have you installed (Ubuntu server, Ubuntu desktop, Kubuntu, Lubuntu, Xubuntu, Ubuntu MATE, et al.) , and which release number? Different releases have different tools for us to recommend. Please click edit and add that vital information to your question so all the facts we need are in the question. Please don't use Add Comment, since that's our channel to you. All facts about your system should go in the Question with edit – K7AAY Apr 21 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.