Unable to set path in /etc/profile
edcogburn at hotpop.com
Sat Jul 23 20:49:58 UTC 2005
Lee Braiden wrote:
> On Saturday 23 July 2005 19:40, Irene Zimmermann wrote:
>> Appended the following as a root user:
>> export JDK_HOME JRE_HOME JAVA_HOME
>> export PATH
>> echo $PATH returns the original path after reboot.
>> Help please.
> I think you need to set the path in /etc/security/pam_env.conf
Either/or, but not really both (though it doesn't hurt). The pam file is
for setting the base "environment" variables that *ALL* shells see, but
once picked up by the shell, it can still be overridden in the shell's own
normal startup scripts.
Also, note that the pam file can ONLY store *variables*, you can't stick
shell specific options in there like a bash "shopt" command for example.
So if you want to change some of bash's default behavior, you'll still need
to use a shopt command in one of bash's startup scripts to do that, the pam
file can only hold simple variable=value pairs.
As for the PATH variable specifically, there is already a place for setting
that in /etc/login.defs with the advantage that you can declare 2 different
defaults, one for root, one for everyone else. This config file existed
before pam, but pam is slowly taking over many of its old 'jobs' - pam is
now handling security in a uniform centralized manner that used to be
spread out in different programs like login). But as above, it can still
be overridden later, so the OP first needs to check what is running *after*
More information about the ubuntu-users