I have PATH=foo
set in /etc/profile
According to /etc/password
the root
and myaccount
users have /bin/bash
as the login shell.
When I log in as myaccount
, the PATH
has been set correctly from /etc/profile
. If I then sudo su
, PATH
does not include the value set in /etc/profile
.
If I sudo su -
instead then /etc/profile
is sourced. I know it is good practice to do this anyway but I don't see why it's necessary in order to source /etc/profile
.
Why does sudo su
clobber PATH
, disregarding /etc/profile
and how to I make it not?
sudo
can do lots of things depending on how it's configured