Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-08-2011, 10:34 AM
|
#1
|
|
Member
Registered: Sep 2011
Location: Indiana, USA
Distribution: Ubuntu, Fedora, Linux Mint, Debian
Posts: 35
Rep: 
|
visudo: How to let a user run only a certain program as root?
I have scoured the internet (and the Debian man files) to figure out how to allow a user access to only one program as root, using sudo.
I use root for my administrative stuff, but there's one program my normal user, ryan, needs to run. That program is service. I need to be able to run that program, preferably without entering my password every time, so I can start or stop gdm3 whenever I want (I don't use GNOME much).
What I need to know is how to tell visudo that. This line doesn't pass the parse check:
Code:
ryan ALL=(ALL) service
What do I need to type to get it to work? Thanks.
|
|
|
|
09-08-2011, 10:54 AM
|
#2
|
|
Member
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375
Rep: 
|
Try it this way... it should get you the command and handle the password issue the way you want:
Code:
ryan ALL = NOPASSWD:/sbin/service
|
|
|
|
09-08-2011, 11:34 AM
|
#3
|
|
Member
Registered: Sep 2011
Location: Indiana, USA
Distribution: Ubuntu, Fedora, Linux Mint, Debian
Posts: 35
Original Poster
Rep: 
|
Quote:
Originally Posted by SL00b
Try it this way... it should get you the command and handle the password issue the way you want:
Code:
ryan ALL = NOPASSWD:/sbin/service
|
Didn't work. Here's what I got:
Code:
ryan@ryanD610:~$ sudo service gdm3 start
Sorry, user ryan is not allowed to execute '/usr/sbin/service gdm3 start' as root on ryanD610.*****.
Should I replace NOPASSWD:/sbin/service/service with NOPASSWD:/usr/sbin/service?
|
|
|
|
09-08-2011, 11:43 AM
|
#4
|
|
Member
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375
Rep: 
|
Quote:
Originally Posted by Ryan Hoots
Should I replace NOPASSWD:/sbin/service/service with NOPASSWD:/usr/sbin/service?
|
Correct.
|
|
|
|
09-08-2011, 12:12 PM
|
#5
|
|
Member
Registered: Sep 2011
Location: Indiana, USA
Distribution: Ubuntu, Fedora, Linux Mint, Debian
Posts: 35
Original Poster
Rep: 
|
Quote:
Originally Posted by SL00b
Correct.
|
It's working. Thanks, SL00b. 
|
|
|
|
09-09-2011, 01:22 AM
|
#6
|
|
Member
Registered: Nov 2007
Location: Seattle
Distribution: Debian Squeeze, Wheezy
Posts: 160
Rep:
|
One other option: try ' super'. Add the required user to /etc/super.tab
Regards,
Stefan
|
|
|
|
09-09-2011, 09:20 AM
|
#7
|
|
Member
Registered: Sep 2011
Location: Indiana, USA
Distribution: Ubuntu, Fedora, Linux Mint, Debian
Posts: 35
Original Poster
Rep: 
|
Quote:
Originally Posted by propofol
One other option: try ' super'. Add the required user to /etc/super.tab
Regards,
Stefan
|
Sounds interesting... I'll look into that...
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:18 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|