I've googled extensively but haven't found how to add a password option so I don't have to type it in manually. I've created the following alias:
alias int='sudo service network-manager restart'
But I don't want to type in my password every time, is there some command I can pass to the alias with my password?
<user> ALL=(ALL:ALL) NPASSWD:path/to/command
? What is the actual path to the network-manager restart command? I'm not a savvy user... – mind.blank Apr 14 '13 at 11:40which
orwhereis
(more verbose) to find out the full path of a command (Ex.which service
). Anw, this is what you should append to the file:<user> ALL=(ALL:ALL)NOPASSWD:/usr/sbin/service network-manager restart
. Note that sudoers does allow fine grain control using regular expression. More here. – chin Apr 14 '13 at 11:47