Hi!
According to the comment at the top of `/etc/ssh/ssh_config`,
configuration data is parsed in the following order:
1. command line options
2. user-specific file
3. system-wide file
Also, according to that same comment, "[a]ny configuration value is only
changed the first time it is set."
However, as `man ssh_config` states and the original reporter stresses,
`SendEnv` acts differently: it allows appending additional environment
variable names to the list, as well as removing already appended ones
from it by prefixing them with the `-` character.
My take is that what we're facing here is not a bug in how SSH config
file is parsed and applied, but a bug in the Debian-specific system
config: due to 1) the nature of `SendEnv` and 2) the fact that the
system-wide config file is parsed last, it becomes effectively
impossible for a user to prevent ssh from sending environment variables
specified in the system-wide config by editing their local configuration
file only. Even if the user uses `SendEnv -LANG -LC_*` in their config
file, it causes removal of these environment values from the list of
ones to be sent if they are in that list already (e.g. due to a previous
SendEnv directive or command line arguments), but it does not prevent
the system-wide config file from adding these names back to the list
later.
Thus, I think the right course of action here would be for Debian to
comment out the `SendEnv LANG LC_* COLORTERM NO_COLOR` line in the
config file that it ships.
Regards,
Rimas