I set PATH in /etc/profile. I do not have any problem in the case of the general user, but PATH does not go when I become the root authority in sudo. What will you do to succeed PATH which is set by /etc/profile even if I become the root authority in sudo?

link|improve this question

39% accept rate
feedback

2 Answers

up vote 5 down vote accepted

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.

link|improve this answer
feedback

root's path is not changed by /etc/profile (security ...)

you have to set it up separately, (e.g. in root's ~/.bash_profile)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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