Setting a variable for a given SSH 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
You can give a specific value by using
SetEnv in your
Host * SetEnv FOO=bar
Directly specify one or more environment variables and their contents to be sent to the server. Similarly to
SendEnv, the server must be prepared to accept the environment variable.
Assuming your server got the following line in
AcceptEnv LANG LC_* FOO
man ssh_config and