Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What are all of the possible config files where this is being changed?
More importantly, you can see that /sbin and /usr/sbin get clobbered in the init process, where is the best place to fix this??? (And how/where is this happening?)
Yes... You're not loggin in as root, there, so you shouldn't get the sbin paths anyway. Non-root users can often run some sbin things, but normally wouldn't want to anyway.
Switching to root with "su -" should give you the paths back, as well as becoming root, which is, after all, the time when you probably want to run the sbin programs.
In an interactive shell, you'll be running .bash_profile, and in a non-interactive shell, you'll run .bashrc. On RedHat, it makes little difference, but .bashrc will add the ~/bin directory to the path, for user's personal scripts.
They'll also call /etc/bashrc, which sets paths too, but generally by way of the scriptlets in /etc/profile.d/
You'll be glad to know that no paths are getting clobbered, though - the path you've quoted is the right one for a user called "user".
No, your paths are *not* being changed. They're being setup perfectly.
Root's path is different from an ordinary user's because only the root user should be running programs within /sbin and /usr/sbin (and /usr/local/sbin).
Most of the programs won't work as anything other than root anyway. Others may work, but will not do anything useful - for instance, mke2fs won't do anything useful because your ordinary users don't have write access to block devices.
All this is a "good" thing.
The reason that "su" doesn't work, whereas "su -" does, is because "su -" sets up the environment for the user (in this case, root) whereas "su" doesn't.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.