A brief introduction to the usage of sudo
Visodu is used to edit sudo, such as vi. It comes with error checking. It must be capitalized. The change will take effect at that time.
Sudo-l look at the commands that can be executed by the current user-b execute commands in the background. Note that the password verified by sudo is the password of the current user.
To enter a password in sudo format:
User or% group or user category name loggable host = (transformable identity) executable command 1, executable command 2
Password-free sudo format:
User or% group or user category name loggable host = (changeable identity) NOPASSWD: executable command 1, executable command 2
Example:
Location 1, position 2, position 3, position 4.
Root ALL= (ALL) ALL
% wheel ALL= (ALL) NOPASSWD: ALL
Position 3 is used to write changeable identities, such as root
Host_Alias SERVER=no1,no2192.168.1.0/24 defines the host or network segment that can be logged in, and it is written in location 2. It is basically useless and generally uses ALL.
User_Alias ADMINS=liming,gem defines a user class alias, written in location 1
Cmnd_Alias SHUTDOWN=/usr/sbin/halt,/usr/sbin/shutdown defines the category name of the command, if you want to prohibit the execution of the command, add it before! To write the absolute path, write in position 4