Name
sudo
Synopsis
sudo [options
] [command
] sudoedit [options
]files
If you are allowed, execute command as the superuser. Authorized users of sudo and the commands they are permitted to execute are listed in the sudo configuration file, /etc/sudoers. If an unauthorized user attempts to run a command, sudo informs an administrator via email. By default, it sends the message to the root account. Users attempting to run commands are prompted for their password. Once authenticated, sudo sets a timestamp for the user. For five minutes from the timestamp, the user may execute further commands without being prompted for her password. This grace period may be overridden by settings in the /etc/sudoers file. Also see /etc/sudoers for configuration examples. The sudoedit form of sudo is equivalent to running sudo -e.
Options
- -b
Execute command in the background.
- -e
Edit one or more files instead of running a command, running the editor specified by the VISUAL or EDITOR environment variable. If a specified file does not exist, it is created.
- -h
Print help message, then exit.
- -H
Set the HOME environment variable to the home directory of the target user (default is root).
- -i
Run the shell specified in /etc/passwd for the user sudo is being run as.
- -k
Revoke user’s sudo permissions. Similar to -K, but changes user’s timestamp to the Epoch instead of revoking it.
- -K
Remove user’s timestamp.
- -I
List all allowed and forbidden commands for the user on the current host, then exit.
- -L
List parameters that may be set as ...
Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.