Monday, March 9, 2009

Tip: Allow users to shutdown the system on FreeBSD

Operations such as shutdown and rebooting usually require root privileges. However, one may allow other users to run these commands with success.

To allow users to shutdown a FreeBSD system you basically have two options: add the user to the operator group or install and configure sudo to allow usage of the administrative command. I've already covered the latter option in a previous post so I'll only go over the remaining option here.

The steps consist in becoming root and using pw to add the user (in the example bellow username) to the operator group:
% su
# pw groupmod operator -m username
# exit
To reboot the system login to the user account that belongs to the operator group and run:
% shutdown -r now
If you want to power down the system run this instead:
% shutdown -p now
Do take a look at pw(8) and shutdown(8) manual pages for further information.

1 comment:

suchipi said...

Thanks, I was looking for which group I needed to add my normal user into. Now I can shutdown through normal dialogs in the MATE desktop environment (fork of Gnome2)