Linux adds sudo permissions to the user:
The root user for Linux is the Almighty God, any file can enter, any file can be modified, for our rookie is really dangerous ah
So there are times when you need to give the user sudo permissions
Enter Super User mode. That is, enter "Su-", the system will let you enter the super user password, enter the password and enter the Super User mode. (Of course, you can also use root directly)
Adding sudo permissions for a user is to add a/etc/sudoers file
Ouyangjun all= (All) all such a sentence
The default owner of this file has only R permissions, so you need to add w before modifying
chmod u+w/etc/sudoers
Edit the/etc/sudoers file, that is, enter the command "Vim/etc/sudoers", enter the edit mode, find this line: "Root all= (All) all" in the following add
Ouyangjun all= (All) all (here Ouyangjun is your user name), and then save the exit.
If you want to avoid entering your password:
Ouyangjun all= (All) Nopasswd:all
Revoke write permissions for the file. That is, the input command
chmod u-w/etc/sudoers
Then it's all right.
This article is from the "Ouyangjun" blog, make sure to keep this source http://ouyangjun.blog.51cto.com/10284323/1710774
Linux adds sudo permissions to the user: