Skip to Content
Ubuntu: Up and Running
book

Ubuntu: Up and Running

by Robin Nixon
April 2010
Beginner
464 pages
12h 7m
English
O'Reilly Media, Inc.
Content preview from Ubuntu: Up and Running

Using sudo

So, just what is all this talk of root and sudo? Well, root is the name given to the super user on an Ubuntu system. It is an all-powerful user with maximum privileges, allowing it to do anything.

For this reason, Ubuntu actually disables the root user and only allows you to assume it one command at a time. This is because permissions on the filesystem normally prevent you from running dangerous commands that are all too easy to enter accidentally during routine system use, and none of these permissions can hold back root. So, should you become the root user for a particular command but forget to change back, you could end up damaging your installation.

The Ubuntu viewpoint is “better safe than sorry,” so you have to preface every command requiring root privileges with sudo. Thankfully, the developers realized it can be annoying to keep entering your password each time you do this, so after you use sudo and provide your password, you won’t be asked for your password again for another 15 minutes. Hopefully this will be sufficient time to perform all your maintenance.

Logging in As root

That said, if you ever have a lot of work to perform as root or have a specific reason to do so, you can actually log in as root (and also bypass typing all the sudo commands) by entering the following:

sudo -i

This will log you in as the root user with all the dangers previously discussed, so don’t do this unless you know exactly what you are up to. To log back out again, enter the command

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

Ubuntu Made Easy

Ubuntu Made Easy

Rickford Grant, Phil Bull
Ubuntu for Non-Geeks, 4th Edition

Ubuntu for Non-Geeks, 4th Edition

Rickford Grant, Phil Bull

Publisher Resources

ISBN: 9781449382827Errata Page