Skip to content

Commit

Permalink
Print error when login ssh server failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Nov 2, 2023
1 parent fd8a23c commit 2fe97d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/remote_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def connect_ssh(self):
pub_key = self.ssh_pub_key()
ssh.connect(self.ssh_host, port=self.ssh_port, username=self.ssh_user, key_filename=pub_key)
except:
print(traceback.format_exc())

# Try login server with password if public key is not available.
password = RemoteFileClient.remote_password_dict[self.ssh_host] if self.ssh_host in RemoteFileClient.remote_password_dict else get_ssh_password(self.ssh_host)
try:
Expand All @@ -71,7 +73,7 @@ def connect_ssh(self):
# Password only record in memory for session login, not save in file.
RemoteFileClient.remote_password_dict[self.ssh_host] = password
except:
pass
print(traceback.format_exc())

return ssh

Expand Down

0 comments on commit 2fe97d9

Please sign in to comment.