I've been scared too much by the warning about setuid. However I cannot find a way around using it.
I want to be able to run:
arp -s 198.51.100.1 00:53:00:12:34:56
as the user steven
but arp -s requires root.
Would this be the correct way to do it?
sudo nano example.sh
sudo chmod u+s example.sh
sudo chmod og-w example.sh
sudo chmod o+x example.sh
./example.sh
nano
instead? – Steven Apr 19 '14 at 10:41visudo
to edit the sudoers file. It verifies the syntax. Despite the name, it doesn't necessarily invokevi
; set the environment variableVISUAL
to your favorite editor, e.g.export VISUAL=nano
. – Gilles 'SO- stop being evil' Apr 19 '14 at 10:58steven ALL = (root) NOPASSWD: /usr/sbin/arp
works however – Steven Apr 19 '14 at 10:59:
needs escaping in the command. Edited. – Gilles 'SO- stop being evil' Apr 19 '14 at 11:06