Skip to content

Commit b07b90d

Browse files
authored
Merge pull request #188 from maximumG/187-SSH2-connection-improvement
#187 - Improve SSH2 authentication when server send DISCONNECT_MSG
2 parents 0d72fe2 + eb77f5a commit b07b90d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Exscript/protocols/ssh2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ def _paramiko_auth(self, username, password):
291291
# Finally try all supported login methods.
292292
errors = []
293293
for method in auth_methods:
294-
# Some OSes (e.g. JunOS ERX OS) do not accept further login
294+
# Some OSes (e.g. JunOS ERX OS, Huawei) do not accept further login
295295
# attempts after failing one. So in this hack, we
296296
# re-connect after each attempt...
297-
if self.get_driver().reconnect_between_auth_methods:
297+
if self.get_driver().reconnect_between_auth_methods or not self.client.active:
298298
self.close(force=True)
299299
self.client = self._paramiko_connect()
300300

0 commit comments

Comments
 (0)