Skip to Main Content
Learning Unix for Mac OS X, Second Edition
book

Learning Unix for Mac OS X, Second Edition

by Brian Jepson, Dave Taylor
December 2002
Beginner content levelBeginner
160 pages
4h 22m
English
O'Reilly Media, Inc.
Content preview from Learning Unix for Mac OS X, Second Edition

Superuser Privileges with sudo

Your Mac OS X user account runs with restricted privileges; there are parts of the filesystem you don’t have access to, and there are certain activities that are prohibited until you supply a password. For example, when you run the Software Update utility from System Preferences, Mac OS X may ask you for your password before it proceeds. This extra authentication step allows Software Update to run installers with superuser privileges.

You can invoke these same privileges at the command line by prefixing a command with sudo, a utility that prompts you for your password and executes the command as the superuser. You must be an Admin user to use sudo. The user you created when you first set up your Mac will be an Admin user. You can add new Admin users, or grant Admin status to a user in System Preferences Accounts.

Tip

What if you don’t know your administrative password? If you forgot your password, read the Mac OS Help to direct you. You might need to reboot your computer off your original Mac OS X install CD-ROM, then when you get to the installer, select the Reset Password... option from the Installer menu. The program will then prompt you for a new password and set it for your machine. Reboot again (without the CD-ROM), and you should be set forever.

You may need to use sudo when you install Unix utilities or if you want to modify a file you don’t own. Suppose that you accidentally created a file in the /Users directory while you were doing ...

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 for Absolute Beginners

Mac OS X for Absolute Beginners

Wallace Wang
JMP Connections

JMP Connections

John Wubbel
Using csh & tcsh

Using csh & tcsh

Paul DuBois

Publisher Resources

ISBN: 0596004702Catalog PageErrata