In ssh_config
, one can choose to export some environment variables to the host using SendEnv
.
Is there also a way to force a given value for this variable, per host? For example, would it be possible to export variable $FOO
with value bar
only when connecting to host example.com
?
Best Answer
You can't give a specific value for an environment variable in
ssh_config
, but you can certainly send the existing environment variable only to specific hosts.To complete the chain:
Finally, the remote server must have the environment variable listed in
AcceptEnv
in itssshd_config
.