[sudo-users] sudo can't find an executable in my $PATH!

Chris O'Regan chris at encs.concordia.ca
Sat Nov 1 14:16:15 EDT 2008

> Oh, good to see, someone saw this. I was doing more "research" on the
> problem and it is in the fact, that $PATH variable gets modified by
> sudo! I set sudoers to preserve PATH, but no good.
> env and "sudo env" gives me different things! Why is that?

It's hard to say exactly what it happening in your case because you have
not forwarded the output of "sudo doit" and "sudo -l". It could be
something as simple as not setting the PATH in the right place.

Sudo does clean up the environment before running the command. How much
depends on how it is configured. Suffice to say this is a good thing
because sudo can be a dangerous command.


More information about the sudo-users mailing list