__author__ = 'gyz'
# _*_ coding: UTF-8 _*_
# @create_time:2021/11/15
# @File: ssh_device
# 打包命令pyinstaller -F package$NAME
#
__author__ = 'gyz'
'''
交换机SSH配置:
#创建秘钥
[SW]dsa local-key-pair create
#配置SSH认证类型(密码/其他)
[SW]ssh user user1 authentication-type password
[SW]ssh user user1 service-type stelnet
[SW]stelnet server enable
#配置认证模式
[SW]user-interface v 0 4
[SW]authentication-mode aaa
[SW]protocol inbound ssh
#配置本地用户信息
[SW]aaa
[SW]local-user user1 password cipher Huawei@123
[SW]local-user user1 privilege level 15
[SW]local-user user1 service-type ssh
[SW]
'''
import time
import paramiko
class switch9312:
ip = ''
cmd_list = []
def __init__(self, ip, cmd_list, user='admin