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 |
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-21-2008, 07:56 PM
|
#1
|
LQ Newbie
Registered: Nov 2007
Posts: 8
Rep:
|
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.
|
|
|
01-22-2008, 02:34 PM
|
#2
|
Senior Member
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761
Rep:
|
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.
|
|
|
01-24-2008, 12:42 AM
|
#3
|
LQ Newbie
Registered: Nov 2007
Posts: 8
Original Poster
Rep:
|
Thanks for that. All I'd found was ways of turning off the password for *all* commands. I need to get better search terms 
|
|
|
01-25-2008, 11:22 AM
|
#4
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
Welcome to LQ, kamahl.
What search terms were both of you using? -- A comparison might yield a lesson in search design.
|
|
|
01-25-2008, 12:09 PM
|
#5
|
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
|
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.
|
|
|
03-03-2008, 08:40 AM
|
#6
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
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.
|
|
|
All times are GMT -5. The time now is 04:25 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
|
|