This is the line in the sudoers file that is flushed:
Defaults env_reset
You can get around this by adding PATH to env_keeps or by adding this line:
Defaults env_keep = "PATH"
EDIT: meder, you do not disable env_reset, you just bypass the reset path
Or you can remove the offensive line env_reset .
Even better, you can declare a secure_path that will replace PATH when you run sudo:
Defaults secure_path="/bin:/usr/bin"
This way you can control which specific directories will be included in the path.
h4unt3r
source share