So it can be useful to know that /etc/environment is read by SSH aswell as login. The format is "VARIABLE=VALUE" for each line. In my case, I needed to force TMPDIR to "/var/lib/gforge-dop/chroo
You can test if your variable is added by doing :
ssh user@host env
and see if your variable is listed properly by env.
If you need to set environment variables per user, you can use ~/.ssh/environment. In order to do that, you need to set PermitUserEnvironment to "yes" in sshd_config and restart sshd.


1 comments:
Very useful info, thanks. I didn't find /etc/environment documented anywhere, but it solved a problem I was having.
Post a Comment