Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This
This chapter is from the book

Running Commands as the Superuser

When you log in to your computer, the account you use is a normal user account. This account is restricted from performing various system administration tasks. The security model behind Ubuntu has you run as a normal user all the time and dip into the system administrator account only when you need to. This prevents accidental changes or malicious installation of unwanted programs and similar things.

To jump to this superuser account when using the terminal, put the sudo command before the command you want to run. As an example, if you want to restart the networking system from the command line, run:

username@computer:~$ sudo /etc/init.d/networking restart

The command to the right of sudo is the command that should be run as the administrator, but sudo lets you run the command as the current user. When you run the above command, you are asked for the administrator password. This is the same password as the one you established for the first user you added when you installed Ubuntu on the computer. If you are using that user's account, just enter your normal password.

When you have authenticated yourself to sudo, you will not be asked for the password again for another 15 minutes.

  • + Share This
  • 🔖 Save To Your Account