[SLUG] shutdown: you must be root to do that!

Al Girling al21 at firenet.uk.com
Fri Sep 19 18:12:01 BST 2003


On Fri, Sep 19, 2003 at 02:51:15PM +0100, Gavin Baker wrote:
> You forgot to make it setuid root.
> 
> 	# chmod u+s /sbin/shutdown
> 
> shutdown needs to be run as root. Its hardcoded into the program.
>  
> Making it setuid root means it will run *as* root for anyone who has permission 
> to run (+x) it, which is just root and members of the adm group in your case.

O.K. I think I've got this sorted now.  The problem was with my lack of
understanding of setuid.  From your original mail you point out how bad setuid
is so I avoided that section of the instructions.  Which left me without the
necessary permissions.  I didn't see that all important missing 's' in the
permissions -rwsr-x--- which makes all the difference.  My stupidity rather
than your failure to instruct.

Many thanks Gav.

Jamie, have you considered an alias for the /sbin/shutdown command.

Try this in your .bashrc

alias buggeroff='/sbin/shutdown -h now'

or whatever word you find most suitable! :)

Unless anyone can give a reason why this would be a bad idea.

Oh!  Yes!  Nearly forgot.  I used to use this some time ago, but forgot it
through lack of use.  Found the scrap of paper it was on this afternoon.
Instead of logging out and back in to make any alterations to .bashrc work.
Type;

$ . .bashrc

Your new settings will then be available to you!  Cool huh!

Toodle pip,

Al
-- 
Al Girling			Registered Linux User: 290080
				http://counter.li.org





More information about the Scarborough mailing list