I have a simple shell script that uses the killall
command. I would like to run this command without needing to enter my password. I've brought up visudo
and inserted the following line into it:
anthony localhost = (root) NOPASSWD: /usr/sbin/myscript
I close Terminal, reopen it, and issue my script command. I am immediately greeted with a prompt for my password.
What am I doing wrong? Is this the proper way to do this?
sudo myscript
? If you have edited the sudoers file correctly then you shouldn't need thesudo
in front of it (and if you put it there, I think it will still prompt you for your password). if it's something somehow related tokillall
then I will undelete my answer, which turned out to be slightly irrelevant - though in principlekillall
shouldn't need root access, I think... Depends on what process you're killing, I guess.