When I use
ssh, I notice that my
TERM variable is forwarded automatically. This is quite useful, but I'm wondering what other variables are forwarded or set. So far I've found the following information:
sshman page lists several variables that are set, none of which is
- My local
SendEnvcommands, none of which mention
- The remote
/etc/zshenv, etc. files don't mention
TERMand wouldn't be able to forward it without the cooperation of the local machine anyway.
- I have no
~/.ssh/environmentfile on the remote machine, or
~/.ssh/configfile on either machine (I find that
sshworks almost the way I want straight out of the box). Again, even if I did have this file, it wouldn't be able to forward
TERMwithout my local machine's help.
- When I run
sshwithout specifying a command, the
TERMenvironment variable is forwarded (and if I set it to something else locally before running
ssh, the new value is forwarded; it's not just being set to a constant).
- When I run
sshand specify a command (e.g.,
ssh remote-host env), the
TERMenvironment variable is not set.
So, my question basically has two parts. The first is, where is
TERM being set, and why can't I find any documentation indicating this (and, on a related note, if I for some reason did not want to forward
TERM, how would I stop this)? The second, related, part is what other environment variables are being set that aren't mentioned in the
ssh man page or the various configuration files I mentioned?