LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Blogs > rich_c
User Name
Password

Notices

Rate this Entry

How to allow users to execute admin applications.

Posted 11-16-2009 at 11:44 AM 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
Code:
visudo
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:
Code:
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:
Code:
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
Code:
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 850 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement

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