Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

This question already has an answer here:

Platform: Ubuntu 10.04 VM running out of VirtualBox

File details:

-rwxr-x---  1 myuser myuser  123 2013-10-31 16:10

The executable is visible in the directory:

>type is ./

I do have . in the path:

>echo $PATH

Running it without sudo works fine:


but not with sudo:

sudo: command not found


share|improve this question

marked as duplicate by slm, jasonwryan, warl0ck, Anthon, manatwork Nov 1 '13 at 7:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

PATH is not inherited in sudo. Doing so would be a security flaw since someone might stick something unsafe in PATH such as .. – jordanm Oct 31 '13 at 20:32

1 Answer 1

"Sudo resets PATH, along with many other environment variables, for security reasons. It doesn't matter what is set in /etc/profile, unless you run sudo -i.

The sudo manual page, under SECURITY NOTES, gives an insight about the security implications, along with the options you have to fiddle in your /etc/sudoers file to modify these restrictions, after you understand the implications of doing so."

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.