In /etc/login.defs
what are ENV_PATH
and ENV_SUPATH
used for?
From /etc/login.defs
:
# REQUIRED The default PATH settings, for superuser and normal users.
#
# (they are minimal, add the rest in the shell startup files)
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
-
They seem to default to the same exact initial path values that I have for
PATH
in/etc/profile
in Debian Jessie. -
In man it says very briefly what login.defs is used for. This page says a bit more.
PATH
and ENV_PATH
don't appear to be connected or dependent on one another, or if they are it's not obvious to me how one depends on the other.
Do I need to update my bash system paths in both of these two places? Or is there a way to have paths defined in only one place, and to refer to this master path value?
Or perhaps are these just used as a default in the case that PATH
is missing? … So they don't really matter that much ???
Best Answer
Quoting the man page about login.defs
Both are used to define the PATH variable of regular, super user initially. My login.defs has the ENV_PATH, ENV_SUPATH defined to following
I added a new user 'foo'
When i login as 'foo'
Similarly for 'root'
The PATH can be overridden by the user via .bashrc, .bash_profile, .zshrc ...
To make the answer complete
ENV_PATH is used to define PATH for a regular user
ENV_SUPATH is used to define PATH for a super user