next up previous contents home.gif
Next: Fat partition Up: Extra Configurations and Software Previous: Email   Contents

Reboot and shutdown commands

I don't like having to su into root when I need to turn the laptop off, or reboot. So I made some changes so ordinarily users could use these commands. I have the following to /etc/sudoers: ==========================================================================
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification
#  ALL = DUMPS, KILL, PRINTING, SHUTDOWN, HALT, REBOOT

# Cmnd alias specification
 ##added by ded 3/10/04
 Cmnd_Alias     PRINTING = /usr/sbin/lpc, /usr/bin/lprm
 Cmnd_Alias     SHUTDOWN = /usr/sbin/shutdown
 Cmnd_Alias     HALT = /usr/sbin/halt, /usr/sbin/fasthalt
 Cmnd_Alias     REBOOT = /usr/sbin/reboot, /usr/sbin/fastboot
# Defaults specification

# User privilege specification
root    ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

# Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
#%users  localhost=/sbin/shutdown -h now 
  ##added by ded 3/10/04
  %users ALL = PRINTING, SHUTDOWN, HALT, REBOOT, \
        NOPASSWD: ALL

========================================================================== Just make sure the commands are in the regular usures path. My overly aggressive .cshrc should cover that.



Douglas Dawson 2004-03-31