0

I'm having trouble to understand how the PATH variable is affected by sudo. I can run the command activator as a normal user because I've added the path where this application resides to that user's .bashrc file. I can also ensure this is the case with:

user@kubuntu:~$echo $PATH
/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/activator-1.3.2

When I try to run sudo activator, however, I get sudo:

activator: command not found

I tried to resolve this by adding the path /opt/activator-1.3.2 to /etc/environment, but I still get the same "command not found" error even though sudo echo $PATH shows that /opt/activator-1.3.2 is in the PATH variable. Even more confusing for me is the fact that if I run sudo su, then the activator command runs fine.

robguinness
  • 121
  • 3

1 Answers1

1

You can always do:

sudo env "PATH=$PATH" godi_console As a security measure on Debian, /etc/sudoers has the secure_path option set to a safe value.

  • Thank you for this answer, but this doesn't really help clear my confusion. I would like to know why the PATH variable is not the same under sudo. What does this secure_path option actually mean? – robguinness May 19 '15 at 07:17