Re: Shutting down as a user
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.