Sudoers in Ubuntu

By default, root acount in ubuntu is locked. This means that you cannot login as root directly or use the su command to become the root user, however, since the root account physically exists it is still possible to run programs with root-level privileges. This is where sudo comes in; it allows authorized users (normally "Administrative" users) to run certain programs as root without having to know the root password.

This means that in the terminal you should use sudo for commands that require root privileges; simply prepend "sudo" to all the commands you would normally run as root. For more extensive usage examples, please see below. Similarly, when you run GUI programs that require root privileges (e.g. the network configuration applet), you will also be prompted for a password. Just remember, when sudo asks for a password, it needs YOUR USER Password, and not the root account password.

How To add sudoers users in Ubuntu

All users in the admin group are sudoers. So, if you want some user to have sudo capability then you have to add it in that group. This is how to add it :

[email protected]:~$ sudo adduser eko admin
Adding user `eko' to group `admin'...
[email protected]:~$ sudo adduser mardi admin
Adding user `mardi' to group `admin'...

In /etc/group admin group will automatically added :


Problem when can't login using Root or SUDO Account

If we dont have Root password or dont have access using SUDO then here the trick: Start our ubuntu in recovery mode. In this way we will be logged in as root, without the need to type a password. If the recovery mode is not available, use a live distribution, mount the root partition and manually add the user we want in /etc/group in the line for the admin group, like this :

[email protected]:~$ sudo vi /etc/group



The content of this field is kept private and will not be shown publicly.
If you have a Gravatar account, used to display your avatar.
  • Lines and paragraphs break automatically.

More information about formatting options

This blog uses the CommentLuv Drupal plugin which will try and parse your sites feed and display a link to your last post, please be patient while it tries to find it for you.
Jawab pertanyaan ini untuk membedakan apakah anda pengunjung atau spam.
1 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.