Showing posts with label sudoers file. Show all posts
Showing posts with label sudoers file. Show all posts

Friday, January 18, 2013

Install Packages from Non-Admin Account in Linux Distro



In my last blog “Add user account to root in Ubuntu”, I had written about how we can add or give all root access to any account. Now in this blog I will explain you that how to give only installation access to any Non-Admin account. After giving this access to non-admin account, the user of this account can install as well as remove any packages to and from Non-Admin account.
This is one of most important trick for those Companies and Organization whose Admin is not able to install and removes each packages from every PC’s of each employee.
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

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
After this, on next line of above statement writes following configuration,
         UserName ALL=NOPASSWD : /usr/bin/apt-get , /usr/bin/aptitude
You can change username with your non-Admin account name, save the sudoers file and logout from root account and try to install packages from non-Admin account.

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.