Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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

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

    
/etc/paths? /etc/paths.d/*? –  Daniel Beck Jun 16 '11 at 20:45
1  
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

1 Answer 1

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 built-in 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.