shutdown by regular user

Tom H tomh0665 at gmail.com
Thu Mar 26 13:43:30 UTC 2015


On Thu, Mar 26, 2015 at 7:03 AM, william drescher
<william at techservsys.com> wrote:
>
> How can a non-privileged user initiate a shutdown.
>
> There is one person with an administrative account and sudo privleges.
> There are 3 others with no account.  Frequently, in case of emergency
> shutdown the admin user is not available.
>
> I would like to set up a regular user but make it possible for that user to
> run shutdown. In Unix I would use asroot, but Ubuntu 14.4 LTS does not have
> that.

Create a shutdown group, eg "shutgrp", add the users that you want to
allow to shutdown to it, and run "sudo visudo -f
/etc/sudoers.d/shutdown" to create "/etc/sudoers.d/shutdown" with:

@shutgrp box=(root) '/sbin/shutdown -hP now'

where "box" is the hostname of the system where you'd like to allow this.




More information about the ubuntu-users mailing list