pre6上普通用户不能重启与关机,所以想用sudo.
在/etc/sudoers用加入一行
huting ALL=/sbin/reboot NOPASSWD
可以在命令行下输入sudo有错误
[huting@MagicLinux huting]$ sudo /sbin/reboot
Sorry, user huting is not allowed to execute '/sbin/reboot' as root on MagicLinux.
[huting@MagicLinux huting]$
[huting@MagicLinux huting]$