h3c设备使用paramiko模块连接(SSHException:Channel closed)
发表于:2024-10-21 作者:千家信息网编辑
千家信息网最后更新 2024年10月21日,使用产品为:VSR1000,版本号为:Version 7.1.059, ESS 0323L03。问题:使用python语言的paramiko模块,通过ssh协议登录连接VSR设备时报错,提示: par
千家信息网最后更新 2024年10月21日h3c设备使用paramiko模块连接(SSHException:Channel closed)
使用产品为:VSR1000,版本号为:Version 7.1.059, ESS 0323L03。
问题:
使用python语言的paramiko模块,通过ssh协议登录连接VSR设备时报错,提示: paramiko.ssh_excetion.SSHException:Channel closed。详细信息见截图。
paramiko.ssh_exception.SSHException: Channel closed. ===== invoke_shell()
正确的解决方法如下:
H3C设备登录记录#!/user/bin/env pythonimport sysimport paramikoimport timedef Testsshcon(ip,port,username,password): try: sshcon=paramiko.SSHClient() sshcon.set_missing_host_key_policy(paramiko.AutoAddPolicy()) sshcon.connect(ip,port,username,password,compress=True) #print "ok" #print 'ipaddress %s,port %d,uername %s,password %s'%(ip,port,username,password) print "ssh secuees" cmds=['dis cpu\n','dis version\n'] conn=sshcon.invoke_shell() for cmd in cmds: time.sleep(1) conn.send(cmd) time.sleep(1) print "command" out=conn.recv(1024) print out sshcon.close() except Exception,e: print "connet error",eif __name__=="__main__": Testsshcon('10.10.10.10',22,'username','password')
设备
登录
模块
产品
产品为
信息
截图
方法
时报
版本
语言
问题
提示
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
软件开发 中台
华为hana服务器
4g无线视频服务器
网络安全宣传片mp4
DNS服务器在哪里获得
信息工程系计算机网络技术专业
新华三服务器设置usb启动
番禺区网络安全局
六安系统软件开发定制
mysql数据库运维的常用工具
软件开发专业都要学什么软件
并发请求 数据库
软件开发过程和工具
客户视角 服务器安全
万人服务器
数据清单和数据库
广州港集团软件开发社会招聘
9.17网络安全大会
工控网络安全标准体系
哪个网易服务器最好用
u8 数据库设计
dhcp网络技术
自学计算机网络技术的软件
浙江电力软件开发
宏代码筛选的数据库
飞云服务器关闭时间
锦州互联网科技公司都干啥的
软件开发小组最新完整版
软件开发的成本票是啥
新乡市六八网络技术有限公司