I want to allow sudo this way:myuser ALL=NOPASSWD:/usr/bin/pkill -fx /usr/sbin/nethogs -v 3 -s || /usr/sbin/nethogs -v 3 -sso I get only a single running instance of nethogs.visudo accepts it, but I am unable to run these commands without a password...Failed attempts:  sudo '/usr/bin/pkill -fx /usr/sbin/nethogs -v 3 -s || /usr/sbin/nethogs -v 3 -s'sudo /usr/bin/pkill -fx /usr/sbin/nethogs -v 3 -s || sudo /usr/sbin/nethogs -v 3 -sPS.: this version of nethogs is compiled from its cvs on sf.net
sudoers conditional/combo command is possible?
sudo
You can only use the names or paths of programs or script (and optionally arguments for them) in the sudoers file  shell constructs like || won't work.Quoting man sudoers:command name ::= file name |                 file name args |                 file name ''The easiest way to work around this will be to create a script that executes your set of commands, make it writeable only by root and grant to permission to execute it via sudo.The manpage for sudo actually gives an example that executes commands in a subshell, but I haven't found a way to allow that in the sudoers configuration (and neither has the sudo-users mailing list).