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