2

I was trying to make shutdown without root user using visudo

I tried the following still it did not work for me

hawk ALL=NOPASSWD:/sbin/shutdown -h now

manugupt1
  • 109
  • 2
  • 9

1 Answers1

3

Try this

hawk ALL = NOPASSWD: /sbin/shutdown

then use

sudo shutdown -h now 

to shut the system down

user9517
  • 115,471
  • 20
  • 215
  • 297
  • yes.. I tried that but it did not work – manugupt1 Jun 13 '10 at 20:20
  • If hawk is your username and you are logged in as hawk it should work. What is the error message you get from sudo ? – user9517 Jun 13 '10 at 20:44
  • this would not work thanks for your help.. to make it work we should use sudo /sbin/shutdown -h now, this works I had kinda avoided it for long anutime I tried it – manugupt1 Jun 14 '10 at 08:43