[sudo-users] NOPASSWD: fails when using -i option

Todd C. Miller Todd.Miller at courtesan.com
Tue Jul 3 09:27:27 EDT 2012


The -i flag, when used by itself, runs the target user's shell in
login mode.  When a command is specified along with -i, that command
is run via the target user's shell in login mode.

This is the only way to have the user's startup files (e.g.
.profile) be read before the command is executed.

You should be able to use a sudoers rule like this:

%mygrp ALL=(otheruser) NOPASSWD: /bin/sh -c /path/to/script.sh

 - todd



More information about the sudo-users mailing list