We all know that in most Linux System there are two basic types of accounts, it can be a normal user and super user. 

What is the difference between normal user and super user?

Root User Account  - a special account that includes a full access to any programs and files on the system. 

Normal User Account - a user account that has access to his/her own home directory. Remember that programs and files that are accessible has been granted access to (by the root user).

Allowing normal user to do task with a privilege os root user, without giving a root password, you can use the sudo tool. Using sudo there is a possibility to grant users access in using certain commands on certain hosts or what you can do is grant them access to the root user. 

Where do sudo logs every command?


Its log to a log file, where the system administrator can keep an eye in sudo

Sudo Configuration

Run the following command to find out exactly what sudo permissions you have on your system.

sudo -l

This could result in the following output for the example user “peter” on the “server1” host:

Matching Defaults entries for peter on server1:

env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User peter may run the following commands on server1:


What the last line means is that user can execute sudo on all hosts as any target user for any command?

Below are the list of sudo command options 

-l - list the permissions of the sudo invoking user

-u - run command as another user

-e - you have the ability to edit one or more files instead of executing a command

sudo -e” alias for sudoedit 

Sudo Command Examples

For the root user command, use the following syntax:

<em>sudo</em> command

You may  install the “git” version control software using apt-get package manager. You may try this without using sudo:

apt-get install git

You would get this error message:

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?

Adding the sudo command before our previous command, system will execute our command with the root user privileges: 

sudo apt-get install git

You can use the -u option to run commands as a user, just use the following command:

sudo -u username command

You can  run desktop (graphical windowing) applications as another user, use the gksu command.