admin管理员组

文章数量:1026989

一、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(

一、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(

本文标签: 系统中用脚本Windowsshell