博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Python使用paramiko远程连接linux
阅读量:4559 次
发布时间:2019-06-08

本文共 445 字,大约阅读时间需要 1 分钟。

import paramikohost = "192.168.180.126"   # 需要远程的PCport = 22   # 远程端口user = "kylin"   # 登陆的用户名pwd = "kylin"   # 登陆的密码# 建立SSH连接ssh = paramiko.SSHClient()ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())ssh.connect(host, port, user, pwd, timeout=10)stdin, stdout, stderr = ssh.exec_command("ifconfig")orig_result = stdout.read()str_result = orig_result.decode("UTF-8")print(str_result)

转载于:https://www.cnblogs.com/APeng2019/p/10719386.html

你可能感兴趣的文章
web项目中全局常量的添加
查看>>
搬运工程 启动!
查看>>
局部加权回归(LWR) Matlab模板
查看>>
Connect to the DSP on C6A8168/DM8168/DM8148 using CCS
查看>>
hibernate在使用getCurrentSession时提示no session found for current thread
查看>>
【Luogu1471】方差(线段树)
查看>>
【agc028E】High Elements(动态规划,线段树,贪心)
查看>>
DEV中svg图标的使用
查看>>
Codefroces Gym101572 I.Import Spaghetti-有向图跑最小环输出路径(Floyd)
查看>>
有关位运算的操作+二进制状态压缩
查看>>
Eclipse插件 -- 阿里巴巴扫描编码规插件
查看>>
(1.1)学习笔记之mysql体系结构(内存、进程、线程)
查看>>
markdown测试
查看>>
Java-Maven-Runoob:Maven 依赖管理
查看>>
杂项-Log:log4net
查看>>
杂项-Java:EL表达式
查看>>
tarroni music
查看>>
unity 使用RotateAround的使用注意
查看>>
[SDOI2009]HH的项链
查看>>
CodeFirst模式,容易引发数据迁移问题(不建议使用)
查看>>