Giving Specific users access to the reboot command
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
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.
Giving Specific users access to the reboot command
Dear All,
Sorry if this is in the wrong forum, it just seems like the most suitable place to ask this.
I am a single user of my own machine, and I would like to give myself access to the reboot command, tather than su ing then doing it ot just doing ctrl-alt-del. This is a learning experience and I would like the satisfaction of knowing how to do it.
I have already tries chown <username> /sbin/.reboot and chmod 777 /sbin/reboot to no avail. Can anyone please help?
It's either installing sudo, use PAM or try this:
open up /etc/inittab and look for the line where you CTRL+ALT+DEL, and add "-a" to shutdown args.
echo $LOGNAME >> /etc/shutdown.allow
now you're allowed to shutdown using the 3 finger salute.
If you're using PAM you can change the /etc/pam.d config for the shutdown service using allow lists. Add an "auth" line under the last auth statement w/o quotes: "auth required /lib/security/pam_listfile.so item=user sense=allow file=/etc/pam.d/shutdown.allow onerr=fail"
echo $LOGNAME >> /etc/pam.d/shutdown.allow.
Haven't tested the PAM solution for shutdown, but this works on other services so it should work with shutdown as well.
unSpawn you kinda lost me. I do not with to shut down using ctr-alt-del. What I wish to do is simply allow a normal user, to use the reboot command without having to be root (superuser).
Hey, stop confusing this guy with the wrong answers!! i saw this post yesterday cuz I had the same issue and I found the solution!!
man sudoers
actually just go to /etc and edit sudoers. at the end of the file there should be 3 commented out lines to the tune of 'examples' and two examples beneath. change one to say (don't quote me on the syntax)
$:users allow:/sbin/shutdown -h now NOPASSWD:ALL
like i said look up 'man sudoers' to get the syntax right if my memory is wrong also to reboot just duplicate the line and replace '-h' with '-r'
you shouldn't have to even check the man pages if you're astute enough!!
BTW halt and reboot can only be run in runlevel 1 and 6, if they are called in ANY other runlevel it tels the system ./sbin/shutdown -h now
um.. for the benefit of others.
i'm sick of round about answers on web forms. so i took matters into my own hands. besides, if it's so damn old... WTF!! why are you replying to me?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.