[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/environment not read by su?



On Wed, May 21, 2003 at 12:43:17PM +0200, Reckhard, Tobias wrote:
> I've placed the proxy environment variable declarations into
> /etc/environment. They appear fine when I ssh into the machine. However,
> when I 'su -' to root, they're not set. I enabled root login via SSH
> temporarily and when I login as root directly via SSH, the variables are
> set.
> 
> So my question is: How can I make su read /etc/environment?

/etc/environment is weird; it's read by pam_env, and I'm never entirely
sure about what syntax is valid. (Is quoting allowed? If so, what kind?
The PAM documentation just says that it's a file full of KEY=VAL pairs.)
I normally prefer dropping things into the normal shell startup files.

However, putting 'auth required pam_env.so' in /etc/pam.d/su should make
su read /etc/environment, I think. Experiment with a root shell open in
another window so that you can recover easily if anything goes wrong. :)

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: