Python脚本——连接到SSH并运行命令
16lz
2021-01-22
I already know there are ssh modules for Python, that's not for what I'm looking for. What I want to have is an python script to do the following:
我已经知道Python有ssh模块,这不是我要找的。我想要的是一个python脚本来完成以下工作:
- > connect to an [ input by user ] SSH host
- >连接到[用户输入]SSH主机
- > connect using the credentials [ provided by the user ]
- 使用[由用户提供的]凭据连接>
- > run command on the SSH host [ telnet to [host - input by user ]
- 在SSH主机上运行命令[telnet to[主机-用户输入]
- > Select menu item in the telnet session
- >在telnet会话中选择菜单项。
Thanks in advance,
提前谢谢,
Best regards,
最好的问候,
5 个解决方案
#1
10
Use paramiko
, see http://jessenoller.com/2009/02/05/ssh-programming-with-paramiko-completely-different/ for a through example of using it.
使用paramiko,请参阅http://jessenoller.com/2009/02/05/ssh-programming-with-paramiko complete - difference /了解使用paramiko的示例。
更多相关文章
- Python脚本如何获取当前环节和用户等信息
- Django 1.5多用户身份验证或
- python接入微博第三方API之2接入用户登录和微博发布
- linux修改文件所属用户和组
- linux centos 宝塔主机控制面板安装和安全狗安装过程记录
- shell用户配置详解及bash命令参数
- linux用户管理及用户权力下放
- Linux学习笔记(九)--RedHat 7.0之用户身份与文件权限、存储结构与
- 如何查找特定用户可执行的所有文件(不是最新的)