Name

sudo

Synopsis

sudo [options] command

Executes a command as the superuser or as another user on the system. Before sudo executes command, it prompts for the current account password (not root’s). This lets a system administrator allow privileged processes without knowing the root password.

sudo determines authorized users by consulting the file /etc/sudoers. If the current user account is listed in /etc/sudoers and is authorized there to run command, that user can then run subsequent sudo commands without being prompted for a password. However, if five minutes (the default value) passes between sudo commands, the user is prompted again for a password at the next sudo attempt and given another five minute window.

By default, Mac OS X includes the admin group in the sudoers file and gives that group authorization to run any command with sudo. Mac OS X accounts given administrator privileges become members of the admin group and thereby receive complete sudo privileges.

Note that the file /etc/sudoers must not be edited directly. Instead, use the visudo command.

All attempts to use the sudo command are logged to the system log.

Options

-b

Run command in the background, but don’t allow use of shell job control to manipulate the process.

-h

Print a usage statement.

-H

Set the HOME environment variable to the target user’s home directory path. By default, sudo doesn’t modify HOME.

-k

Kill the timestamp by setting it past the default timeout value. A password is not needed to use this option. ...

Get Mac OS X Tiger in a Nutshell 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.