Name

sudo

Synopsis

                  sudo [options] [command]

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 will inform an administrator via email. By default, it will send 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 their password. This grace period may be overriden by settings in the /etc/sudoers file.

Options

-b

Execute command in the background.

-h

Print help message, then exit.

-k

Revoke user’s sudo permissions. Similar to -K, but changes user’s timestamp to the Epoch instead of revoking it.

-l

List all allowed and forbidden commands for the user on the current host, then exit.

-p promptstring

Use the specified promptstring to prompt for a password. The string may contain escape codes %u and %h, which will be replaced with the current user’s login name and local hostname.

-s

Run the shell specified in the SHELL environment variable, or the default shell specified in /etc/passwd. If a command is given, it should be a shell script and not a binary file.

-u user

Run command as the specified user instead of the root user. This may also be specified as a user ID number using # uid.

-v

Update timestamp ...

Get Linux in a Nutshell, Fourth 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.