diff --git a/confluent_server/confluent/plugins/shell/ssh.py b/confluent_server/confluent/plugins/shell/ssh.py index 6c336d98..b6a08eed 100644 --- a/confluent_server/confluent/plugins/shell/ssh.py +++ b/confluent_server/confluent/plugins/shell/ssh.py @@ -72,7 +72,6 @@ class SshShell(conapi.Console): while self.connected: pendingdata = self.shell.recv(8192) if pendingdata == '': - self.datacallback(conapi.ConsoleEvent.Disconnect) return self.datacallback(pendingdata) @@ -103,6 +102,13 @@ class SshShell(conapi.Console): self.password = '' self.datacallback('\r\nlogin as: ') return + except paramiko.ssh_exception.NoValidConnectionsError as e: + self.datacallback(str(e)) + self.inputmode = 0 + self.username = '' + self.password = '' + self.datacallback('\r\nlogin as: ') + return self.inputmode = 2 self.connected = True self.shell = self.ssh.invoke_shell()