I've just spun up a brand new CentOS 7 VM (bash version 4.2.46) with Vagrant using the centos/7 box, and when I'm logged in as the vagrant user, this is my PATH:
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vagrant/.local/bin:/home/vagrant/bin
When logged in as root, here's the PATH:
/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
I know that /etc/profile
is adding /usr/local/sbin:/usr/sbin
(at the end for most users, at the start for root), and the /etc/skel/.bash_profile
that ends up in the vagrant home directory is adding /home/vagrant/.local/bin:/home/vagrant/bin
, but where is the initial setting coming from?
At present I have no explanation of why users end up with /usr/local/bin:/usr/bin
in their PATH, and root gets the others.
(Frankly, the ordering of the root PATH seems very odd, given that /usr/local/sbin
and /usr/sbin
should be at the end, according to /etc/profile
.)