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()
评论列表
文章目录