For once, a non-hardware question from me!
What is the correct way of making 'ordinary' users (i.e., not root) able to shut the PC off at the end of the session? I find that (at least, on Slackware) an ordinary user can't use '/sbin/halt' or '/sbin/shutdown' because an error message is returned, saying something along the lines of "You must be root do do that".
I've checked the permissions of /sbin/halt and /sbin/shutdown and they're both rwxr-xr-x, so I don't think that's the problem. I know that ordinary users can use Ctrl+Alt+Del and that works well here, turning off the power at the end of the shutdown procedure, but it would be nice to be able to make the 'shutdown' command in the IceWM menu work for ordinary users, too.
Thanks for any clues on this one!
Cheers,
Gerald.
Hi Gerald
I use "sudo halt" on my Morphix install.. It does of course require sudo to be installed and /etc/sudoers configured correctly.
Regards, Paul.
On Saturday 08 November 2003 11:52 am, Edenyard wrote:
What is the correct way of making 'ordinary' users (i.e., not root) able to shut the PC off at the end of the session? I find that (at least, on Slackware) an ordinary user can't use '/sbin/halt' or '/sbin/shutdown' because an error message is returned, saying something along the lines of "You must be root do do that".
Similarly, I've put links to the commands "/usr/bin/super shutdown -r now" and "/usr/bin/super shutdown -h now" in my fvwm main menu, with an appropriate entry in /etc/super.tab (the super.tab manpage explains how) detailing which users I think should be allowed to use "super shutdown".
On Sat, 8 Nov 2003, Paul wrote:
I use "sudo halt" on my Morphix install.. It does of course require sudo to be installed and /etc/sudoers configured correctly.
Regards, Paul.
On Saturday 08 November 2003 11:52 am, Edenyard wrote:
What is the correct way of making 'ordinary' users (i.e., not root) able to shut the PC off at the end of the session? I find that (at least, on Slackware) an ordinary user can't use '/sbin/halt' or '/sbin/shutdown' because an error message is returned, saying something along the lines of "You must be root do do that".
On 08-Nov-03 Edenyard wrote:
For once, a non-hardware question from me!
What is the correct way of making 'ordinary' users (i.e., not root) able to shut the PC off at the end of the session? I find that (at least, on Slackware) an ordinary user can't use '/sbin/halt' or '/sbin/shutdown' because an error message is returned, saying something along the lines of "You must be root do do that".
I've checked the permissions of /sbin/halt and /sbin/shutdown and they're both rwxr-xr-x, so I don't think that's the problem. I know that ordinary users can use Ctrl+Alt+Del and that works well here, turning off the power at the end of the shutdown procedure, but it would be nice to be able to make the 'shutdown' command in the IceWM menu work for ordinary users, too.
Thanks for any clues on this one!
One solution is to install a root-owned cron job which, every minute, looks for a file (e.g.) /var/user.shutdown and, if it finds it, deletes the file and then runs /sbin/shutdown on root's behalf.
Then you need to arrange it that when the user does whatever the user does to shutdown, all this achieves is something like
touch /var/user.shutdown
with, possibly, a reassuring message like "The system will start to shut down within 1 minute". Don't know what you have to do to arrange this using IceWM.
(Think "Dungeons and Dragons")
Best wishes, Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 167 1972 Date: 08-Nov-03 Time: 12:36:59 ------------------------------ XFMail ------------------------------
On Sat, Nov 08, 2003 at 11:52:05AM +0000, Edenyard wrote:
What is the correct way of making 'ordinary' users (i.e., not root) able to shut the PC off at the end of the session?
I've no idea of the "correct" way, as I wouldn't allow anybody but root to shutdown any of my boxes. ;)
What I'd probably do is make /sbin/halt SUID root(chmod it to 4750), then chown it to root.shutdown or somesuch, and add the users you want to be allowed to shutdown the box, to the `shutdown' group.
id@nooped.com (Wayne Cornish) writes:
Edenyard wrote:
What is the correct way of making 'ordinary' users (i.e., not root) able to shut the PC off at the end of the session?
CTRL-ALT-DEL seems perfectly sensible to me.
I've no idea of the "correct" way, as I wouldn't allow anybody but root to shutdown any of my boxes. ;)
Only root has access to the power cable, then?
What I'd probably do is make /sbin/halt SUID root(chmod it to 4750), then chown it to root.shutdown or somesuch, and add the users you want to be allowed to shutdown the box, to the `shutdown' group.
I'd suggest doing that to shutdown instead of halt - it appears (from Debian's source) to be actually designed for setuid running, which halt is not, and making programs setuid when they are not designed for it can lead to unintended consequences.
Wayne Cornish id@nooped.com wrote:
On Sat, Nov 08, 2003 at 11:52:05AM +0000, Edenyard wrote:
What is the correct way of making 'ordinary' users (i.e., not root) able to shut the PC off at the end of the session?
What I'd probably do is make /sbin/halt SUID root(chmod it to 4750), then chown it to root.shutdown or somesuch, and add the users you want to be allowed to shutdown the box, to the `shutdown' group.
SetUID evil! I'd definately go for a sudo job, and probably alias halt to sudo halt, reboot to sudo reboot and shutdown to sudo shutdown. Also makes it easy to add any other programs in to the list, *AND*, means you can limit which users have access to which groups of commands.
Just my 2ps worth.
Brett