From: Eric S. Raymond Date: Mon, 26 Mar 2012 11:59:00 +0000 (-0400) Subject: Deal with ssh spoofing messages. X-Git-Tag: 1.7~1 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=3b8cb7cf726b08e6e8089a10cafd7d5664fe0a9b;p=ssh-installkeys.git Deal with ssh spoofing messages. --- diff --git a/ssh-installkeys b/ssh-installkeys index 4ef8f27..900b1da 100755 --- a/ssh-installkeys +++ b/ssh-installkeys @@ -609,7 +609,12 @@ class ssh_session: elif seen == 5: sys.stderr.write("FAILURE: check hostname\n") raise RuntimeError - + # Remote execution will fail noisily if the host key hes changed. + # Pass this message through to the user so there will be a chance + # to recover. + if '@@@' in child.before: + sys.stdout.write(child.before) + raise SystemExit, 2 return child.before def ssh(self, command): "Execute a command on the remote host, returning its output."