webduvet
Posted on May 22, 2023
After installation or just after a an OS update or some package update docker engine starts to complain about insufficient permissions.
Particularly it complains about permission to access /var/run/docker.sock
docker ps
// permission denied message
$> ls -la /var/run/docker.sock
The output should show root:docker as {ownder}:{group}.
Run also
ls -l /lib/systemd/system/docker.socket
The output should show root:docker as {ownder}:{group}.
If it shows root:root there is a problem
sudo chgrp docker /lib/systemd/system/docker.socket
Check the following:
groups
Current user should be member of these groups: docker
, kvm
.
if the docker
group doesn't exist add it
sudo groupadd docker
If the new group is added or the group is there but current user is not a member, add it.
sudo usermod -aG kvm $USER
The current user now should be visible in group file /etc/group
or when running
getent group
or simply
groups
If not try running:
sudo su $USER -c groups
If the list of groups contain kvm
and docker
you need to log out and log back in or somehow restart system-auth
.
After that it should work or there is further problem unrelated to the above.
verify
docker ps
Posted on May 22, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 24, 2024