Tuesday, 23 October 2012

Ubuntu - What the hell is SUDO?

Ubuntu - What the hell is SUDO?

If you are unfamiliar with unix systems you may never have heard of "sudo" or the powers of this command on your system. It stands for Super User DO and temporarily grants you privileges normally reserved for a superuser or root.

When do I use it?

When using the terminal there are some commands that are reserved for many reasons that include system breaking potential or system compromise and cannot be executed under normal circumstances. These actions may include editing system files and settings or installing new applications.

How do I use it?

An example familiar to some is when you install an application.  Here I try to install amarok music player:
ubuntu@ubuntu:~$ apt-get install amarok
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
So the system has decided to block me from installing but I want to continue so I prefix my command with sudo.
ubuntu@ubuntu:~$ sudo apt-get install amarok
[sudo] password for ubuntu: 
It will now proceed with the installation when I supply my password. Note that I require my password and not the password for a superuser.

In summary

Beginners: When you get a pop-up asking for your password (like when you install software from the Software Center) you are invoking the SUDO command, basically telling the system that you are sure you want to proceed.

Intermediate: SUDO is a command you use in terminal where you grant yourself temporary superuser privileges. Proceed with caution!

Advanced: Why are you reading this?




No comments:

Post a Comment