Permission to shutdown now!

Asked

Viewed 311 times

0

How do I give permission to execute the command shutdown to the user ?

I am using OS Linux Mint 13.

  • sudo does not solve your problem?

  • no, it asks for the root password!

  • Why don’t you add your user in sudoers?

  • I already added, but it doesn’t work, send an ex please!

  • 1

    I think this question is off-topic for Sopt, maybe a place to ask is http://unix.stackexchange.com or http://askubuntu.com (Mint is a Ubuntu "Fork")

1 answer

1

One of the alternatives is to edit the file /etc/sudoers and to include in this file the following line:

user host = (root) NOPASSWD: /sbin/shutdown

Where:

user = user you want to give permission to shutdown without asking for password

host = hostname (execute hostname command to know)

To edit the file /etc/sudoers use the tool visudo, see below:

sudo visudo -f /etc/sudoers

A real example (my computer backup):

luiz storage = (root) NOPASSWD: /sbin/shutdown

Running the command:

sudo /sbin/shutdown -r now

The above command will give an immediate shutdown and reboot the computer. No password will be requested.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.