On Thu, Aug 16, 2001 at 10:37:51AM -0700, Paul Mackinney wrote: > 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.
I don't mean to take away from your fun, but, as others suggested, the sudo command is quite nice for this stuff. With the proper setup in /etc/sudoers, you could just use the commands with your normal user account: $ sudo halt $ sudo reboot And with the NOPASSWD setting, you could avoid exposing your root password. -- Brian Nelson <[EMAIL PROTECTED]>