LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-21-2008, 07:56 PM   #1
kamahl
LQ Newbie
 
Registered: Nov 2007
Posts: 8

Rep: Reputation: 0
Question Sudoers file no password


I want to allow sudo to run without a password for the commands:
  • shutdown
  • poweroff
  • hibernate
  • grub-reboot
  • reboot

while still asking a password for all other commands.
 
Old 01-22-2008, 02:34 PM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761

Rep: Reputation: 80
Using the search function of this forum I found:

No password for sudo?
http://www.linuxquestions.org/questi...r-sudo-442808/

One of the posts has an example of what your asking for.
 
Old 01-24-2008, 12:42 AM   #3
kamahl
LQ Newbie
 
Registered: Nov 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for that. All I'd found was ways of turning off the password for *all* commands. I need to get better search terms
 
Old 01-25-2008, 11:22 AM   #4
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Welcome to LQ, kamahl.

What search terms were both of you using? -- A comparison might yield a lesson in search design.
 
Old 01-25-2008, 12:09 PM   #5
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
You can do this in the sudoers file...

Code:
Cmnd_Alias	STUFF = /usr/sbin/shutdown, /usr/sbin/reboot
User_Alias	USERS = bobbyt, johnd, janed

USERS           STUFF = NOPASSWD: STUFF
My syntax might be wrong (I'm not at my computer right now); but the basic idea is make an alias with all the commands that you want (comma delimited); and then assign the alias to the user/users (a better way would be to assign users to a group then the group to the command alias...like I did above). Then you'd specify that you want it with no password.

Good Luck!

-C

Last edited by custangro; 01-25-2008 at 12:11 PM.
 
Old 03-03-2008, 08:40 AM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
One of the best things LQ can do for its members to to teach them (us) how to help them(our)selves.

It's one thing to spout lines like "RTFM" &"Google is your friend", it's another to give concrete lessons in, say, better search design. We have an opportunity to do that here.

Please, kamahl & bsdunix, post your search terms so that we can compare & all learn something.
 
  


Reply

Tags
sudoers



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sudo password for users, a.k.a. sudoers Micro420 SUSE / openSUSE 2 04-21-2006 09:23 PM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM
sudoers file cactus-bob Linux - Newbie 2 03-11-2004 11:24 AM
help with sudoers file ogden2k Linux - Security 4 03-11-2003 10:39 AM
The Sudoers File Rubicone Linux - Security 0 05-02-2002 06:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:27 AM.

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
Open Source Consulting | Domain Registration