In some cases the user can simply be added to the wheel group. This should give the user enough privileges to shut the machine down. A more reliable approach is to make use of Sudo, which was specifically designed to allow ordinary users to execute certain super-user-only commands.
shutdown: you must be root to do that!
poweroff: must be superuser.
reboot: must be superuser.
halt: must be superuser.
The following section will explain how to setup sudo to allow other users to the machine down through the command line under the Gentoo distro.
Login as su:
Enter the following:
Replace YourUserName with the user name which requires shutdown privileges.
# Runas alias specification
YourUserName ALL=(root) NOPASSWD: /sbin/reboot
YourUserName ALL=(root) NOPASSWD: /sbin/halt
YourUserName ALL=(root) NOPASSWD: /sbin/poweroff
YourUserName ALL=(root) NOPASSWD: /sbin/shutdown
See this guide on how to create a group which allows all its users to shut the machine down.
Post a Comment