tasks.py 文件源码

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

项目:mybak_admin 作者: 154650362 项目源码 文件源码
def sshclient_execmd_ps(hostname,execmd,port=port, username=username, password=password):
    paramiko.util.log_to_file("paramiko.log")
    s = paramiko.SSHClient()
    s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    s.connect(hostname=hostname, port=port, username=username, password=password)
    stdin, stdout, stderr = s.exec_command (execmd)
    stdin.write("Y")  # Generally speaking, the first connection, need a simple interaction.
    out = stdout.read()
    print out
    s.close()
    return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号