self.ssh = paramiko.SSHClient()
self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
self.ssh.connect(self.hostname, username=self.username, password=self.password)
except SSHException:
#do something
I was wondering how to handle errors raised by Paramiko when trying to connect to an SSH server?
Depends on your application.
Here are some possible actions:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.