Examples of sudo commands and sudo command examples
Sudo: authorize normal users to execute a command and run it as a specified user.
Configure sudu, enter the command mongodo, find the target line, and edit the configuration file under the target line.
, The first column writes the common user, the second column ALL = ([user name]) who is the user name, the first column of the user will be granted the permissions of the second column of users
The third column can be ALL? ALL indicates ALL commands. You can also write a fixed command. The command must be an absolute path. Multiple commands are separated by spaces. The configuration is the same as that of vi: wq save
The meaning of the figure is to authorize the wasuser to execute the ls and cp commands as the root user.
Common users can view the root directory. Sudo can also use ls directly without absolute paths.
Add NOPASSWD to the configuration file: allows common users to execute the root command without entering a password.
Mongodo has many configuration methods, but the purpose is the same. You can use them by referring to the example in the annotations.