On Thu, Sep 16, 2004 at 11:21:55PM +0200, Iwan van der Kleyn wrote: > Brad Sawatzky wrote: > > >On Thu, 16 Sep 2004, Teuchteu wrote: > > > > > >I created a user with root privileges who just makes a shutdown -h now > >(Well i edit the /etc/passwd file to launch a script that shut down the > >computer). We wave the same at work on Unix platform (we don't have root > >privelege :(( > >I'm sure it's far to be the best solution, but it is simple, and easy... > > > > > > > >Of course, any user with the shutdown-user password (or everyone if the > >password is nulled) can trivially get root privs using 'su <shutdown > >userid>'. The correct way to do this is with sudo or equivalent. > > > > > see: http://www.courtesan.com/sudo/ > > Add with the visudo command a line like the following to the > /etc/sudoers file > > john hostname = NOPASSWD: /sbin/halt, /sbin/reboot > > and you can use the comands without password.
They can also halt -fp. Instant shutdown, no unmount or anything. I'd go with a wrapper script, say: # wrapinit if [ x"$1" = x"0" ] || [ x"$1" = x"6" ]; then init "$1" else echo "Usage: wrapinit {0,6}" >&2 exit 1 fi # end wrapinit wrapinit 0 - shutdown & poweroff wrapinit 6 - shutdown & reboot -- The world's most effective spam filter: ln -sf /dev/full /var/mail/$USER -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]