Why sudo does it ?
[01:50:34 shaul]# cat /etc/sudoers
# sudoers file (/etc/sudoers).
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
##
# Cmnd alias specification
##
Cmnd_Alias HALT=/sbin/halt
Cmnd_Alias REBOOT=/sbin/shutdown -r "now"
Cmnd_Alias SHUTDOWN=/sbin/shutdown -h "now"
##
# User privilege specification
##
# root can run anything on any machine as any user
root ALL=(ALL) ALL
# shaul may run these commands:
shaul ALL=HALT,REBOOT,SHUTDOWN
[01:51:33 shaul]# exit
[01:53:38 shaul]$ sudo -l
You may run the following commands on this host:
(root) /sbin/halt
(root) /sbin/shutdown -r "now"
(root) /sbin/shutdown -h "now"
[01:55:05 shaul]$ sudo rebbot
sudo: rebbot: command not found
[01:55:14 shaul]$ sudo reboot
Sorry, user shaul is not allowed to execute "/sbin/reboot" as root on rakefet.
[01:55:21 shaul]$
BTW: My sudo group is empty, if that matter.
Reply to: