shutdown command
How do you give other users rights to shutting down the system using the following command: 'shutdown -h now'? Right now, I have to log in as root and shut it down, but I would like to give rights to my users (family). I currently use RH Fedora.
Thank you, Michael R. DeLorenzo |
/sbin/halt does the same thing. You can get it so anyone can run it by changing it suid root (which means it always runs as root, nomatter who runs it). Do that by typing:
Code:
chmod +s /sbin/halt |
Shutdown is meant to be run by root, which tells all other users and procs that the system is going down. Read ->
$ man shutdown I don't know if a user could execute it, and don't think one should, but... |
If he knows that his family are the only other users on the computer then setting /sbin/shutdown or /sbin/halt to run suid root shouldn't be an issue.
|
I'm a purist. If I want to manipulate the box to work wacky, I'll go back to Mirco$loth
and always "login as root," so to speak. :} |
So you suggest his family either have to ask him to shutdown the computer for them, meaning they can't turn it off if he's not present, or just press the power button? So, without them being able to run 'shutdown' how do you propose they switch the machine off??
|
You shouldn't alter the permissions on the shutdown script - it's in the sbin directory, so it should keep those permissions. Instead, what you should do is use sudo to allow them to run this command...
|
Hi, hope this help.
If you have sudo installed, then you can add users (or groups) in /etc/sudoers You can add something like: #to give a group the right to shutdown %group_name localhost=/sbin/shutdown -h now #to give a user the right to shutdown user_name localhost=/sbin/shutdown -h now The user then need to execute sudo followed by the command. When asked for a password, it's their own password (not the root). check man sudo too. Cheers :) |
All times are GMT -5. The time now is 10:02 PM. |