报错信息

上午的时候数据组的同事跟我说有几个程序报错,经过查看log发现找到报错信息:

paramiko.ssh_exception.SSHException: Error reading SSH protocol banner

经过搜索,得知引起该错误的原因是因为banner_timeout默认设置太短,只有15s。

错误分析

经查看paramiko库下面的transport.py下面的Transport代码如下:

class Transport(threading.Thread, ClosingContextManager):
self.banner_timeout = 15
# how long (seconds) to wait for the handshake to finish after SSH

重设banner_timeout属性值

网上的方法大多数是修改源码,重新安装,感觉略麻烦。这里在代码里面进行属性重新设置。

transport = paramiko.Transport((self.host, self.port))
print(transport.banner_timeout)
transport.banner_timeout = 30
print(transport.banner_timeout)

经过测试,两次打印出来的属性值不同,说明属性设置成功,问题解决。

最新文章

  1. 运维请注意:”非常危险“的Linux命令大全
  2. 最全面的 C++ 资源、框架大全
  3. ios github网址
  4. public static void main(String[] args){}函数理解
  5. 状压DP SGU 223 Little Kings
  6. 象写程序一样写博客:搭建基于github的博客
  7. 安装eclipse for c/c++环境
  8. linux环境中 对tomcat配置java环境
  9. 超强vim配置文件
  10. angular中ueditor插件的使用
  11. 用sql语句按周、按月、按季、按年统
  12. winsock编程WSAEventSelect模型
  13. 无锁同步-JAVA之Volatile、Atomic和CAS
  14. 【Centos 7】使用screen恢复终端连接
  15. vue_条件渲染_v-if_v-else_v-show
  16. open()函数 linux中open函数使用
  17. SpringDataJPA
  18. Jira客户端
  19. atoi函数原型
  20. Linux sort命令使用方法

热门文章

  1. C,通信,多线程,数据库小练习——在线电子词典第一版
  2. 几个重要的开源视频会议SIP协议栈
  3. ShopNC B2B2C多用户商城网站系统源码
  4. 【BZOJ1857】传送带(分治经典:三分套三分)
  5. CVE-2018-4878
  6. bootstrap3 文档随看
  7. js转换时间戳成日期格式
  8. C# 运用作用域
  9. React后台管理系统-商品管理列表组件
  10. SpringBoot之HelloWorld仔细分析