Monday, September 17, 2012

Add User Account to root in Ubuntu


Whenever we create any user account which doesn't has the authority of the “sudo” (Super user do) command, then that user account doesn't have any kind of permission to do anything with System. But as per the future requirement, we have to give the permission of “sudo” Command to the user account. Now how to do this?
 There are two ways to do this activity, first from the account that has the permission to used “sudo” command or the second way is from the root. Now what you have to do is just open the “sudoers” file which is located at /etc/sudoers using your favorite text editor.

    To use gedit you have to do following:

    Open the Terminal and type:

    sudo gedit /etc/sudoers

    If you want to use vim you can simply enter the following into the Terminal:

    sudo visudo


Fig. Opening sudoer file in vim editor
When you used the “sudo visudo” command in terminal the “sudoers” file is open in terminal with vim editor.
   
Once you have the sudoers file open, scroll down to the line:
   
root   ALL = (ALL)    ALL

Add the following line below the root line (replacing “user” with the name of the account you wish to give sudo access to)

user   ALL = (ALL)    ALL


Fig.2 Adding user account to root
For example, your account name is “Admin”, then simply replace the user with Admin.

Admin  ALL=(ALL)  ALL

Save and close the file.  The new user has now been added.

No comments:

Post a Comment