EDIT
I ran the following:
$ echo $USER
goldy
$ hostname
goldy-ThinkPad-X1-Carbon-6th
$ sudo visudo -f /etc/sudoers.d/kill and added goldy goldy-ThinkPad-X1-Carbon-6th = (root) NOPASSWD: /bin/kill
And tried rebooting. Still what I run kill I'm asked for a password.
Tho I notice this:
$ sudo cat /etc/sudoers | grep includedir
#includedir /etc/sudoers.d
I didn't want to remove # without being sure I'm not screwing anything up :)
Is that the missing step?
Because It seems like that directory should be included by default:
$ sudo cat /etc/sudoers.d/README
# As of Debian version 1.7.2p1-1, the default /etc/sudoers file created on
# installation of the package now includes the directive:
#
# #includedir /etc/sudoers.d
OP
I have the following shell function to kill a port
function kill-port {
PORT=$1
sudo kill -9 $(sudo lsof -t -i:$PORT)
}
How can I run it w/o the need to input a password?
I've seen here how to use pkill w/o password, how do I do the same for kill?