windows系统中用Python调用linux系统shell脚本

一、windows系统先安装 1、安装python3.5 2、安装paramiko pip install paramiko 3、卸载cryptography==2.5 pyth

一、windows系统先安装

    1、安装python3.5

    2、安装paramiko
        pip install paramiko

    3、卸载cryptography==2.5
        python -m pip uninstall cryptography==2.5

    4、安装cryptography==2.4.2
        python -m pip install cryptography==2.4.2

二、python脚本

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import paramiko
def ssh(sys_ip,username,password,cmds):
    try:      
        client = paramiko.SSHClient()
        client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        client.connect(sys_ip, 22, username=username, password=password, timeout=20)
        
        #key_file = paramiko.RSAKey.from_private_key_file(

发布者:admin,转转请注明出处:http://www.yc00.com/web/1739558142a4133924.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信