Python paramiko SSHException:通道已关闭

问题描述

我使用paramiko模块按如下顺序执行命令:

ssh.connect(IP,username='root',password='xxxx',port=22) #xxxx stands for the password
...
...
command = "sg_raw /dev/sd-8a 7f 00 0e 00 00 00 00 08 f9 09 00 00 00 00 00 01"
stdin,stdout,stderr = ssh.exec_command(command,timeout=60)
...
...
command = "disktool -s|grep 0002810L4000241"
stdin,timeout=60)

代码中的...代表忽略代码。有时在执行命令"disktool -s|grep 0002810L4000241"时,它会引发Exeception:SSHException:channel close。偶尔会发生此错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)