sudo PATH and bash

sudo PATH and bash

By : -

I just spent a bit of time troubleshooting a path issue with sudo on a CentOS server.  This is a note to self to preserve this bit of knowledge.

When dealing with sudo, the only time the PATH environment variable will be preserved is if it’s in .bashrc and NOT in .bash_profile.

Leave a Reply

Your email address will not be published. Required fields are marked *