#743972 openssh-client: ssh reprocesses configuration files even when CanonicalizeHostname is not set #743972
- Package:
- openssh-client
- Source:
- openssh
- Description:
- secure shell (SSH) client, for secure access to remote machines
- Submitter:
- Uwe Storbeck
- Date:
- 2015-10-01 09:36:09 UTC
- Severity:
- important
Dear Maintainer,
I have an ssh configuration which allows me to easily access
local hosts (which are reachable directly) and remote hosts
(which are only reachable through a HTTP proxy). The
configuration file (simplified) looks like this:
Host a
Hostname 172.18.1.1
Host b
Hostname 172.18.1.2
[..]
Host *.*
ProxyCommand nc -X connect -x gateway:8080 %h %p
The upgrade of openssh-client from version 1:6.5p1-6 to 1:6.6p1-2
breaks this configuration. ssh now reprocesses the config file
with the substituted host name even when I explicitly set
CanonicalizeHostname to no. Thus the "Host *.*" pattern matches
always and ssh tries to reach all hosts through the proxy.
CanonicalizeHostname is the only option I have found which should
trigger the reprocessing of the config file. And there seems to
be no other option to explicitly disable this behavior.
Uwe
ssh log with config file:
Host *
CanonicalizeHostname no
Host a
Hostname 172.18.1.1
Host *.*
ProxyCommand nc -X connect -x gateway:8080 %h %p
$ ssh -v a
OpenSSH_6.6, OpenSSL 1.0.1g 7 Apr 2014
debug1: Reading configuration data /home/uwe/.ssh/config
debug1: /home/uwe/.ssh/config line 1: Applying options for *
debug1: /home/uwe/.ssh/config line 3: Applying options for a
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Hostname has changed; re-reading configuration
debug1: Reading configuration data /home/uwe/.ssh/config
debug1: /home/uwe/.ssh/config line 1: Applying options for *
debug1: /home/uwe/.ssh/config line 5: Applying options for *.*
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Executing proxy command: exec nc -X connect -x gateway:8080 172.18.1.1 22
[..]
nc: Proxy error: "HTTP/1.0 504 Gateway Time-out"
ssh_exchange_identification: Connection closed by remote host
severity 743972 important thanks Hi, I can confirm, this is definitely broken. Now matter how canonicalizehostname is set, it reparses the whole config file with the "new" hostname, if you set "Host some.name" in the config section. It even affects "Match originalhost" lines, as it reparses with the new hostname filling in the originalhost. Example:------------------------------------ Host gitadmin User git IdentitiesOnly yes IdentityFile ~/.ssh/id_gitoliteadm Hostname git CanonicalizeHostname no Match originalhost *,!gitadmin IdentityFile ~/.ssh/id_lh ----------------------------------- (Replacing the Match line with a "Host !gitadmin *" doesnt make a difference, same bug). Effect:-------- debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: Hostname has changed; re-reading configuration debug1: Reading configuration data /home/ganneff/.ssh/config debug1: /home/ganneff/.ssh/config line 143: matched 'OriginalHost git' --------- This is just wrong, the originalhost is gitadmin!