O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required