ssh_config, one can choose to export some environment variables to the host using
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
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.
Host example.com SendEnv FOO
To complete the chain:
FOO=bar ssh [email protected]
Finally, the remote server must have the environment variable listed in
AcceptEnv in its
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.