- Starting Up the Terminal
- Getting Started
- Building Pipelines
- Running Commands as the Superuser
- Finding Help
- Moving Around the Filesystem
- Manipulating Files and Folders
- System Information Commands
- Searching and Editing Text Files
- Dealing with Users and Groups
- Getting Help on the Command Line
- Searching for Man Files
- Using Wildcards
- Executing Multiple Commands
- Moving to More Advanced Uses of the Command Line
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.