Skip to content

Commit 2c28780

Browse files
committed
Match "user@host: Permission denied ..." messages
OpenSSH 7.5 changed the text of the permission denied message. As a result ssh_test.SshTest.test_password_required and test_pubkey_required were failing on an Ubuntu 18.04 client, which ships OpenSSH 7.6. Refs - https://bugzilla.mindrot.org/show_bug.cgi?id=2720
1 parent 4356fdf commit 2c28780

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

mitogen/ssh.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,11 @@ def _connect_bootstrap(self, extra_fd):
289289
self._host_key_prompt()
290290
elif HOSTKEY_FAIL in buf.lower():
291291
raise HostKeyError(self.hostkey_failed_msg)
292-
elif buf.lower().startswith(PERMDENIED_PROMPT):
292+
elif buf.lower().startswith((
293+
PERMDENIED_PROMPT,
294+
b("%s@%s: %s" % (self.username, self.hostname,
295+
PERMDENIED_PROMPT)),
296+
)):
293297
# issue #271: work around conflict with user shell reporting
294298
# 'permission denied' e.g. during chdir($HOME) by only matching
295299
# it at the start of the line.

0 commit comments

Comments
 (0)