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

起初在论坛博客看到这篇文章,试着看了下意思就是你的self.banner默认源码时间设置只有15s 让我修改源码在transform.py 然后离线安装paramiko ,试了后还是报上面的错,试了下还是没什么用网友的技术贴并不是都实用还得靠自己啊,这里的问题可以排除了,继续找原因,查看sshd端口
paramiko Exception: Error reading SSH protocol banner
File "/usr/local/lib/python3.5/site-packages/paramiko/transport.py", line 2044, in _check_banner
buf = self.packetizer.readline(timeout)
修改:self.banner_timeout = 15
self.banner_timeout = 300
下载:https://src.fedoraproject.org/repo/pkgs/python-paramiko/ 源码. 我选了:paramiko-1.15.2.tar.gz
tar -xzvf paramiko-1.15.2.tar.gz
cd paramiko-1.15.2 cd parakimo
vim transport.py :s/self.banner_timeout 修改为:300 (按N 下一个)
cd ..
python3 setup.py build
python3 setup.py install
3.查询sshd port 配置
ssh localhost 显示端口竟然是36000
ssh: connect to host localhost port 36000: No route to host
为了确认配置是不是被人改了检查sshd配置:
vi /etc/ssh/sshd_conf
一脸的黑线,你懂的端口默认这里是22 被人改成了36000

重新修改代码port 问题解决:
def run():
ip = '192.168.110.136'
port = 36000
pwd = 'admin'
user = 'root'
client = SshConnect(ip, user, pwd, port)
res = client.exe_cmd('pwd&&cd /usr/local&&pwd') # type should be str
log.info(res)
SSHException: Error reading SSH protocol banner的更多相关文章
- [错误解决]paramiko.ssh_exception.SSHException: Error reading SSH protocol banner 设置
报错信息 上午的时候数据组的同事跟我说有几个程序报错,经过查看log发现找到报错信息: paramiko.ssh_exception.SSHException: Error reading SSH p ...
- Error reading field 'throttle_time_ms': java.nio.BufferUnderflowException
可能出现的问题: ERROR o.a.k.c.p.i.Sender – Uncaught error in kafka producer I/O thread: org.apache.kafka.co ...
- Spring mvc 中使用ftl引用共通文件出错 FreeMarker template error: Error reading included file "/WEB-INF/ftl/common/errormessage.ftl"
初次接触spring mvc,想做一个小的练习项目,结果在ftl文件中引用其它的共通ftl文件时出错.
- vss error reading from file 解决方法
vss error reading from file 解决方法 1 若服务器中存在 vss/data/backup目录,请将该目录删掉2 运行cmd cd.. cd C:\Program Files ...
- Error reading from file 解决办法
最近安装程序遇见这个问题: Error reading from file. 解决办法: 给这个程序添加权限: 添加SYSTEM的读写改..如果比较懒,直接全部允许. 然后Retry.
- ERROR: Got error reading packet from server: A slave with the same server_uuid/server_id as this slave has connected to the master
centos7.5 做binlog-server,拉取主库binlog报错 问题: [root@db03-53 binlog]# mysqlbinlog -R --host=10.0.0.55 --u ...
- 翻译:MySQL "Got an Error Reading Communication Packet" Errors
前言: 本文是对Muhammad Irfan的这篇博客MySQL "Got an Error Reading Communication Packet" Errors的翻译,如有翻 ...
- linux环境,通过rpm删除mysql包,报错:error reading information on service mysqld: Invalid argument
问题描述: 今天在做saltstack的练习,想要通过sls的方式,在远程进行mysql数据库的安装,发现无法通过service的方式启动数据库,然后就想给删除了重新进行安装,在通过rpm -e进行删 ...
- 解决mysql日志显示时间和“Got an error reading communication packets” 问题
[root@calldb3 data]# tail -f mysql.error :.884160Z to db: 'calldb' user: 'call' host: '172.31.50.220 ...
随机推荐
- xss和sql注入学习1
在本地搭建一个存在漏洞的网站,验证xss漏洞和SQL注入的利用方法. 使用phpStudy工具搭建一个美食CMS网站平台. 0x01 xss测试 打开调试模式,定位姓名栏输入框: 尝试在value中 ...
- vs2017+resharper之常用快捷键备忘
1.安装resharper后以vs2017的快捷键为主,让resharper作为一些方便的快捷键的补充. 2.vs2017的c++6的键盘布局模式快捷键 IntelliSence: 列表成员: Ctr ...
- Go变量与常量
变量与常量 变量声明 定义变量时指定变量类型式 定义变量时依靠类型推断 go是静态,强类型语言(java,c++也是如此). 静态语言: 在编译时就能确定变量类型的语言,类型推导在编译阶段可以不用指明 ...
- jenkins 集成环境搭建
http://www.cnblogs.com/jenniferhuang/p/3355252.html
- configparser模块简介
https://www.cnblogs.com/plf-Jack/p/11170284.html
- V8 是怎么跑起来的 —— V8 中的对象表示
V8 是怎么跑起来的 —— V8 中的对象表示 ThornWu The best is yet to come 30 人赞同了该文章 本文创作于 2019-04-30,2019-12-20 迁移至此本 ...
- git 解决每次更新代码都要输入用户名密码
git config --global credential.helper store git pull /git push (第一次输入,后续就不用再次数据)
- MySQL认知
MySQL 认识MySQL MySQL是什么? MySQL是最流行的关系型数据库管理系统,在WEB应用方面MySQL是最好的RDBMS(Relational Database Management S ...
- WPF页面切换
XAML <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft. ...
- spring(四):DI流程
在IoC容器初始化过程中,一般不包含Bean依赖注入的实现. 依赖注入一般发生在应用第一次向容器获取Bean时(getBean),但是有一个例外. 在使用IoC容器时有一个预实例化的配置,即通过laz ...