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

Re: shutdown permission to users?



My solution was to put the following shell-script in ~/bin

#!/bin/sh
# Paul Mackinney's shutdown script for users that know the
# root password
su -c 'shutdown -h now'

Now when I try to shutdown from my user account, I just get prompted for
the root password and it halts. The cool part about this is that I
invariably forget that I'm not root, this avoids those irritating error
msgs. 

Excercises for the newbie: 
1. modify the script to support halt/restart arguments.
2. modify the script to incorporate the suggestion to have a user whose
default shell is /bin/shutdown. This avoids using the root password, in
case your terminal is insecure (telnet, etc.) Note that you might need
to add a "/bin/shutdown" line to /etc/shells to make this work.

:-) Paul

-- 
Paul Mackinney
paul@mackinney.net <- Please note new email address



Reply to: