Thursday, March 31, 2016

What's the meaning of sudo on Ubuntu?


If you are new to ubuntu world or linux in general, you will find that a lot of tutorials on the internet (including on this blog) telling you to run a command with sudo, what exactly sudo means?

Sudo stand for 'Super User DO', despite the name, sudo is actually a program for running security privileges of another user, not just for super user.

Originally sudo is only for super user, that's why it's called sudo (super user do), but now it can be use for other restricted user as well.

I believe sudo also available on mac OS, because mac is also unix based OS, so besides linux, mac also use sudo command.

On ubuntu, you always use sudo command when you try to modify files under root directory, root is the real super user, you can turn your self into root by running sudo su command, like this:

sudo su

You also need to become root when installing or uninstalling software package on ubuntu, which you see very often on this blog, sudo apt-get install [the package name].

Noticed that after running sudo su on the command line, the dollar symbol ($) which indicate that you are regular user, now become # symbol (hashtag), which indicate that you are root.

After become root, you can switch back to normal user, by running 'exit' command. Besides sudo su, you can also use sudo -i, it's basically the same thing.

sudo -i

For graphical program which need to be run under root, you can use program called gksu, gksu is a graphical frontend for su and sudo command.

sudo apt-get install gksu

Gksu is useful for running graphical (GUI) application that requires administrative privileges, like for example synaptic package manager.


No comments:

Post a Comment