Perf.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ARNPerf 作者: zhaoqige 项目源码 文件源码
def SSHConnect(host, user, passwd, port):
    ssh = paramiko.SSHClient()
    try:
        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # any remote (~/.ssh/known_hosts)    
        ssh.connect(host, port = int(port), 
                    username = user, password = passwd, 
                    allow_agent=False, look_for_keys=False)

    except:
    #except paramiko.SSHException:
        ssh.close()
        ssh = None
        print('error> failed to connect', host, 
                '(please check your input: ip, port, user, password)')

    return ssh
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号