[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Allowing users to shutdown



On 24/1/2000 Joseph A. Martin wrote:

	I have set up a Linux workstation for my family's use. They
only need to keep the system on for short periods. (For various reasons I
don't want to leave it on full time.) They are using the icewm window manager,
which, when they hit ctrl-alt-del, gives them the option of shutting down or
rebooting the system. /sbin/shutdown has permissions that do not allow them
to use the shutdown command, unfortunately. What permissions must I
set to allow anyone on that system to shut it down?

you have to use sudo, shutdown is world executable, it just checks that the user executing it is uid 0

what i did for a similar situation was give the users in question sudo privileges to execute shutdown -h -a now and wrote a couple wrapper scripts that i put in /usr/local/bin

so users can just type shutdown and the system goes down. for windowmaker i added a button to the dock which they can double click and the system goes down.

another trick i did is by adding that -a switch to shutdown, this way i can add a script to my .bashrc file to run sudo touch /etc/shutdown.allow and sudo rm -f /etc/shutdown.allow to .bash_logout this way when i am working on the system through ssh they cannot inadvertantly shut it down on me. my wrapper scripts check for that file and either print out a useful message or call xmessage to put up a dialog with a useful message.

I assume you can configure icewm to call something else on control alt delete, just have it call sudo shutdown -h now, or a wrapper script if you go the route i did.

(btw if you use wrapper scripts like i did, you need to add a symlink from /usr/local/sbin/shutdown -> /sbin/shutdown otherwise sudo will try and run your fake shutdown wrapper instead of the real one)


--
Ethan Benson
To obtain my PGP key: http://www.alaska.net/~erbenson/pgp/


Reply to: