[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#872643: openssh: Please quote IP address in suggested "ssh-keygen -f" calls



Source: openssh
Version: 1:7.5p1-5
Severity: wishlist
Tags: patch

Hi,

I was just removing an entry in my known_hosts file with the following:

  ssh-keygen -f "/home/lamby/.ssh/known_hosts" -R [177.220.10.134]:22050

However, my shell is "too smart" and tries to clever things with the
square brackets in the IP address.

I just quoted this bit too, resulting in:

  ssh-keygen -f "/home/lamby/.ssh/known_hosts" -R "[177.220.10.134]:22050"

Patch attached.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-
diff --git a/debian/patches/mention-ssh-keygen-on-keychange.patch b/debian/patches/mention-ssh-keygen-on-keychange.patch
index f2274cb..695316c 100644
--- a/debian/patches/mention-ssh-keygen-on-keychange.patch
+++ b/debian/patches/mention-ssh-keygen-on-keychange.patch
@@ -25,7 +25,7 @@ index 7f169a8f..66c495f4 100644
  				error("Offending key for IP in %s:%lu",
  				    ip_found->file, ip_found->line);
 +				error("  remove with:");
-+				error("  ssh-keygen -f \"%s\" -R %s",
++				error("  ssh-keygen -f \"%s\" -R \"%s\"",
 +				    ip_found->file, ip);
 +			}
  		}
@@ -36,7 +36,7 @@ index 7f169a8f..66c495f4 100644
  		error("Offending %s key in %s:%lu", key_type(host_found->key),
  		    host_found->file, host_found->line);
 +		error("  remove with:");
-+		error("  ssh-keygen -f \"%s\" -R %s", host_found->file, host);
++		error("  ssh-keygen -f \"%s\" -R \"%s\"", host_found->file, host);
  
  		/*
  		 * If strict host key checking is in use, the user will have

Reply to: