rhel 5 root has /bin/bash for shell I removed "pathmunge /usr/local/sbin" from /etc/profile there is no "/usr/local/sbin" in /etc/profile.d/* /etc/bashrc /root/.bashrc /root/.bash_profile /root/.profile

after reboot, /usr/loca/bin still shows up in the root path

How does rhel 5 set default PATH for root ? Which config file has "/usr/local/sbin" ? thanks for your answer.

link|improve this question
/etc/paths? /etc/paths.d/*? – Daniel Beck Jun 16 '11 at 20:45
Any reason not to go ahead and modify root's .bashrc? Also, please reformat your question - it is a little difficult to read in its current form. – new123456 Jun 17 '11 at 2:41
feedback

migrated from stackoverflow.com Jun 16 '11 at 20:43

This question came from our site for professional and enthusiast programmers.

1 Answer

bash has a default value for PATH that is built into the binary. On RHEL it is set to "/usr/local/bin:/bin:/usr/bin". Since /etc/profile and the scripts in /etc/profile.d never explicitly set PATH (they instead modify it with constructs like PATH=$PATH:/somedir), you're left with that builtin PATH as a starting point.

If you'd like get rid of this, you have to explicitly set PATH. I suggest doing it by putting

PATH=/bin:/usr/bin

At the top of /etc/profile

link|improve this answer
feedback

Your Answer

 
or
required, but never shown