sudo: What commands a user can perform with another user's identity through which hosts
sudo COMMAND
-L: Lists all sudo class commands that the current user can use
-K: Disable authentication information, i.e. authentication required for each execution
sudo configuration file/etc/sudoers
A line defines a sudo entry:
Whowhitch_hosts= (runas)tag:command
Supported alias, can be used! Take the reverse
Who:user_alias
Which_hosts:host_alias
Runas:runas_alias
Command:cmnd_alias
Aliases must all and only use a combination of uppercase English letters
User_alias
User's user name
% Group Name
# UID
You can also include other user aliases that are already defined
Host_alias
Host Name
Ip
Network address
Other host aliases
Runas_alias:
User name
% Group Name
Other runas aliases
Cmnd_alias:
Command path
Directory (all commands in this directory)
Other pre-defined command aliases
Example User_alias Useradmin=hadoop,%hadoop,%useradmin
Cmnd_alias useradmincmd=/usr/sbin/useradd,/usr/sbin/usermod,/usr/sbin/userdel,/usr/bin/passwd [A -za-z]*,! /USER/BIN/PASSWD Root
TAG
NOPASSWD: Execute command is not required to enter password authentication
PASSWD
Useradmin all= (Root) nopasswd:useradmincmd
After execution, do not enter the password again within 5 minutes
Execution information will be saved to/var/log/secure
Linux Learning notes < 24 >--sudo