ssh.py 文件源码

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

项目:xf 作者: red-green 项目源码 文件源码
def sshconnect():
    host = raw_input('host to connect to (no port)> ')
    port = input('port> ')
    user = raw_input('username> ')
    pwd = getpass.getpass('password> ')
    client = paramiko.SSHClient()
    client.load_system_host_keys()
    client.set_missing_host_key_policy(paramiko.WarningPolicy())
    client.connect(host, port, user, pwd)
    chan = client.invoke_shell()
    interactive.interactive_shell(chan)
    chan.close()
    client.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号