[sudo-users] sudo with -i option

Todd C. Miller Todd.Miller at courtesan.com
Fri May 1 11:49:22 EDT 2009

In message <BAY134-W43439894BB2B436FC7FF93E76D0 at phx.gbl>
	so spake megadethpaw megadethpaw (megadethpaw):

> I have a solaris 9 server running sudo.1.7.1 and it seems to be working fine
> except for one problem.
> In my sudoers file I have a command set up to run as root user, this works
> fine, eg:-
> sudo <command>
> However if I run the following I see the warning sudo screen and am asked for
> a password:-
> sudo -i <command>
> Can anyone shed any light on this please?

When you run "sudo -i command" what really is executed is "shell
-c command", where shell is the shell of the target user (usually
/bin/sh on Solaris for root).

That means your sudoers file needs to allow "/bin/sh -c command",
not just "command".

 - todd

More information about the sudo-users mailing list