ssh config Host case insensitive

Damien Miller djm at mindrot.org
Tue Feb 4 08:07:20 EST 2014


On Mon, 3 Feb 2014, Ike Devolder wrote:

> Hi,
> 
> There seems to be an issue where a case sensitive Host entry is no
> longer working after update to openssh 6.5
> 
> example entry: (was working before update)
> Host MyHost
> 	Hostname 192.168.0.1
> 	Port 1234
> 	User root
> 	IdentityFile ~/.ssh/id_rsa
> 
> When issuing "ssh MyHost" the outcome is now:
> ssh: Could not resolve hostname myhost: Name or service not known
> 
> When the above entry is changed to:
> Host myhost, the connection works fine again.

This should fix it:

Index: ssh.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/ssh.c,v
retrieving revision 1.398
diff -u -p -r1.398 ssh.c
--- ssh.c	31 Jan 2014 16:39:19 -0000	1.398
+++ ssh.c	3 Feb 2014 21:05:40 -0000
@@ -752,7 +752,6 @@ main(int ac, char **av)
 	if (!host)
 		usage();
 
-	lowercase(host);
 	host_arg = xstrdup(host);
 
 	OpenSSL_add_all_algorithms();
@@ -882,6 +881,7 @@ main(int ac, char **av)
 	}
 
 	/* If canonicalization requested then try to apply it */
+	lowercase(host);
 	if (options.canonicalize_hostname != SSH_CANONICALISE_NO)
 		addrs = resolve_canonicalize(&host, options.port);
 	/*


More information about the openssh-unix-dev mailing list