1import paramiko
2from scp import SCPClient
3
4def createSSHClient(server, port, user, password):
5 client = paramiko.SSHClient()
6 client.load_system_host_keys()
7 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
8 client.connect(server, port, user, password)
9 return client
10
11ssh = createSSHClient(server, port, user, password)
12scp = SCPClient(ssh.get_transport())