报错信息

上午的时候数据组的同事跟我说有几个程序报错,经过查看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)

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

[错误解决]paramiko.ssh_exception.SSHException: Error reading SSH protocol banner 设置的更多相关文章

  1. SSHException: Error reading SSH protocol banner

    当我在使用ssh  远程connect 另一台机器的server 时出现了错误,错误如下,起初以为是自己代码写的有问题,后来本地了一下看了跑的没问题,我就开始根据报错去查寻原因, 起初在论坛博客看到这 ...

  2. MySQL错误日志显示(Got an error reading communication packets)的问题

    错误显示: 2019-05-28T12:54:08.267934+08:00 820396 [Note] Aborted connection 820396 to db: 'Databaseplatf ...

  3. IIS错误解决办法(HTTP Error 500.19 - Internal Server Error)

    window10 切换登陆用户,VS2015的IIS Express 调试代码报HTTP Error 500.19 - Internal Server Error 错误,无法读取配置文件解决办法. I ...

  4. Python paramiko 报错 paramiko.ssh_exception.SSHException: not a valid RSA private key file

    报错的原因是选择的文件不是一个有效的 RSA 密钥文件 现在通过 ssh-keygen 默认生成的密钥文件是新的格式,并非 RSA 格式.打开文件可以看到是以 -----BEGIN OPENSSH P ...

  5. 【Loadrunner】Error -26601: Decompression function 错误解决、27728报错解决方案

       一. Error -26601: Decompression function 错误解决 Action2.c(30): Error -26601: Decompression function ...

  6. 史上最详细 Python第三方库添加方法 and 错误解决方法

    (1):如何添加python第三方库(方法一): File ->> Settings... ->> Project Interpreter (2):如何添加python第三方库 ...

  7. org.hibernate.id.IdentifierGenerationException错误解决方法

    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before ...

  8. ssh超时时间设置(设置ClientAliveInterval),附SSH超详细参数

    作者: daodaoliang 版本: V 0.0.1 日期: 2016年12月29日 0x00 OpenSSH 简介 OpenSSH是采用SSH协议实现的重要的远程连接工具,它对所有的数据进行加密以 ...

  9. vss error reading from file 解决方法

    vss error reading from file 解决方法 1 若服务器中存在 vss/data/backup目录,请将该目录删掉2 运行cmd cd.. cd C:\Program Files ...

随机推荐

  1. php使用GD库实现图片水印和缩略图——给图片添加文字水印

    今天呢,就来学习一下在php中使用PD库来实现对图片水印的文字水印方法,不需要PS哦! 首先,准备素材 (1)准备一张图片 (2)准备一张水印(最好是透明的,即背景是白色底) (3)准备一中字体(在电 ...

  2. ABAP和Hybris的源代码生成工具

    ABAP 有两种方式,一种是ABAP Code Composer, 细节可以查看我的博客Step by Step to generate ABAP code automatically using C ...

  3. openlayers 初步认识(转)

    OpenLayers是一个开源的js框架,用于在您的浏览器中实现地图浏览的效果和基本的zoom,pan等功能.OpenLayers支持的地图来源 包括了WMS,GoogleMap,KaMap,MSVi ...

  4. hdu-2680 Choose the best route---dijkstra+反向存图或者建立超级源点

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2680 题目大意: 给你一个有向图,一个起点集合,一个终点,求最短路 解题思路: 1.自己多加一个超级 ...

  5. python_50_函数与函数式编程

    import time def logger(): """追加写""" time_format='%Y-%m-%d %X'#年-月-日 小时 ...

  6. PAT (Advanced Level) Practise - 1092. To Buy or Not to Buy (20)

    http://www.patest.cn/contests/pat-a-practise/1092 Eva would like to make a string of beads with her ...

  7. django-redis缓存记录

    对于站点缓存,我们使用redis这款key-value数据库.Redis有着更为复杂的数据结构并且提供对他们的原子性操作,这是一个不同于其他数据库的进化路径.Redis的数据类型都是基于基本数据结构的 ...

  8. 二十五、MySQL 索引

    MySQL 索引 MySQL索引的建立对于MySQL的高效运行是很重要的,索引可以大大提高MySQL的检索速度. 打个比方,如果合理的设计且使用索引的MySQL是一辆兰博基尼的话,那么没有设计和使用索 ...

  9. 用dump为什么总会在前面出现/path/debug.php:193

    解决方案,在php.ini中的xdebug中加一行代码:xdebug.overload_var_dump=1

  10. kubernetes中使用ServiceAccount创建kubectl config 文件

    在kubernetes 为不同的项目创建了不同的SerivceAccount,那么如何通过ServiceAccount创建 kubectl config文件呢?使用下面脚本即可 # your serv ...