docker出现Cannot connect to the Docker daemon at unix:///var/run/docker.sock. ...

 

 

Sometimes enter any docker's command reported the following error:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. ...

The reason may be the last time does not exit docker normal, so docker does not start properly, the process can not be found in the corresponding docker / var / run / path.
Solution:

sudo service docker restart

or   

sudo systemctl start docker

 

su to the root user, but did not go to the root user's home directory, that does not change the user's environment.

su - to root down, and go to the root user's home directory, change to the root user's environment.

This involves configuring the environment variables for different users.

sudo

By sudo, we can have some super powers delegated targeted, and the average user does not need to know the root password (sudo are not using the root password, but the current user passwords), so sudo su relative unrestricted rights to He said, it is quite safe, so called sudo also be restricted su, sudo is additionally required license, it is also referred to as su licensing.

sudo process execution command is the current user to switch to root (or other designated users to switch to), and then to root (or other designated switch to the user) identity execute the command execution is completed, the direct return to the current user, and these the premise is to be authorized by the sudo configuration file / etc / sudoers.

sudo configuration file is / etc / sudoers, we can use his special editing tools visodu to configure Once configured, the user can switch to your authorized by sudo -l to see what the command is executed or prohibited .
 

Guess you like

Origin blog.csdn.net/persistencegoing/article/details/93499019