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.

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.