Re: Shutting down as a user
- To: firstname.lastname@example.org
- Subject: Re: Shutting down as a user
- From: Bob Nielsen <email@example.com>
- Date: Fri, 27 Apr 2001 11:02:05 -0700
- Message-id: <20010427110205.A16931@oz.net>
- In-reply-to: <E14t4al-0000AY-00@toraigh>; from firstname.lastname@example.org on Fri, Apr 27, 2001 at 02:31:11AM -0700
- References: <email@example.com> <E14t4al-0000AY-00@toraigh>
On Fri, Apr 27, 2001 at 02:31:11AM -0700, Jim McCloskey wrote:
> On Fri, Apr 27, 2001 at 08:16:06AM -0000, firstname.lastname@example.org wrote:
> > Using debian on a stand-alone laptop I usually work as an ordinary
> > user and find somewhat awkward the fact that I have to su in order
> > to shutdown the PC. Is there a way to power my PC off as a user?
> The other solution is to use `visudo' to edit the `sudoers' file.
> If you add a line like this:
> User_Alias TRUSTIES=larry,mo,curley
> and then in addition:
> TRUSTIES ALL=/sbin/shutdown
> the effect will be that users larry, mo and curley will be allowed to
> execute the `shutdown' command by doing:
> sudo shutdown -h now
> They will be prompted for a password which of course must be given
> correctly before the command is executed.
> Obviously you have to *really* trust larry, mo, and curley for this to
> be a reasonable thing to do. But on a machine where there's only root
> and you, it hardly seems like such a risk,
In such a situation, you could also put a NOPASSWD entry into sudoers,
to avoid having to enter the password:
<username> ALL=NOPASSWD; /sbin/shutdown
See 'man sudoers' for more possiblities.