Ubuntu: sudo, su, root

Notes on the root account on Ubuntu.

On a Linux machine, root is the administrator with all rights. For Ubuntu Linux this is different: Although there is a root account, this is disabled by default for security reasons. The first logged in user can gain temporary root privileges with this command:


After entering the user password, the command is executed with root privileges. After that, the user is back in his shell without root privileges. If you want to use several commands as root, then you can create a root shell:

sudo -s

You have to leave this shell:


There are always situations - e.g. when installing programs - in which a real root account is necessary. Activate this:

sudo passwd

After typing in a root password twice, you can enter the root account with this command:

su -

The root account is deactivated with the following command:

sudo passwd -l root
Go to top