Skip to Content
Mac OS X in a Nutshell
book

Mac OS X in a Nutshell

by Jason McIntosh, Chuck Toporek, Chris Stone
January 2003
Intermediate to advanced
832 pages
32h 40m
English
O'Reilly Media, Inc.
Content preview from Mac OS X in a Nutshell

Name

sudo

Synopsis

sudo [options] command
                  

Executes a command as the superuser or as another user on the system. Before sudo executes command, it will prompt for the current account password (not root’s).

sudo determines who is an authorized user 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 will be 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.

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

Options

-V

Print the version number. When run by root, also list the options used at sudo’s compilation.

-l

List the commands that the current user is authorized to run with sudo.

-L

List all option settings that can be used in the Defaults section of the sudoers file.

-h

Print a usage statement.

-v

Reset the timestamp, giving the user a new five-minute window to use sudo without being prompted for a password.

-k

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mac OS X Internals: A Systems Approach

Mac OS X Internals: A Systems Approach

Amit Singh
C++ In a Nutshell

C++ In a Nutshell

Ray Lischner
Linux Shell Scripting Cookbook - Third Edition

Linux Shell Scripting Cookbook - Third Edition

Clif Flynt, Sarath Lakshman, Shantanu Tushar
Optimized C++

Optimized C++

Kurt Guntheroth

Publisher Resources

ISBN: 0596003706Supplemental ContentCatalog PageErrata