From 3b8cb7cf726b08e6e8089a10cafd7d5664fe0a9b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 26 Mar 2012 07:59:00 -0400 Subject: [PATCH] Deal with ssh spoofing messages. --- ssh-installkeys | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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." -- 2.43.0