Share your knowledge at the LQ Wiki.
Go Back > Blogs > rich_c
User Name


Rate this Entry

How to allow users to execute admin applications.

Posted 11-16-2009 at 12:44 PM by rich_c

On a few forum posts now, I've stated that there must be a way of working around the need to provide the root password for certain administrative tasks. This is generally in response to threads started by people who find typing in a password when they want to install programs (For example.) to be extremely irritating.

I was convinced that there's a way of achieving this using sudo while maintaining some semblance of control of the system in question. I think I found it! I've implemented it on my family's secondary system. For me, our primary system will stick with requiring the root password for all admin tasks. Also, you'll note that the method I describe involves use of the command line and vi. This is appropriate as in my opinion the tweaks involved are for intermediate to advanced users who will appreciate that at best they are modifying the security of their system and increasing the chances of human error causing some sort of breakage.

So, on with how to allow admin tasks to be performed by selected users without the need to enter any passwords. There are three steps.

1.The first step is to open a terminal in root and make a copy of /etc/sudoers in case you need to restore it if it all goes a bit wrong. Then, enter
to edit the sudoers file. The first thing I did was set up a user alias to include all the users I wanted to grant access to. Like this:
User_Alias ADMINS = user1, user2, user3, user4
2.Then, set up an entry in the user specification section of sudoers allowing the group mentioned above authority to run the application(s) of your choice. In my case, I just allowed them to run synaptic on a specified host. My example looked a bit like this:
ADMINS linux_server = NOPASSWD: /usr/sbin/synaptic
A useful resource containing examples of entries in sudoers is the manual here.

3.The last step is to get the users in question to amend or create their shortcut of choice to run
sudo /usr/sbin/synaptic
Plain sudo works with Synaptic but you may need or prefer to use something like gksudo which is better suited to running GUI applications.

Well, there it is. Please bear in mind that this is intended as a rough description of the method used for users with enough experience to follow the steps detailed and with an appreciation of what they want to achieve and the potential consequences.
Posted in Uncategorized
Views 1059 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 11:39 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration