import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname='54.165.97.91',username='ec2-user',password='paramiko123',port=22)
sftp_client=ssh.open_sftp()

#sftp_client.get('/home/ec2-user/paramiko_download.txt','paramiko_downloaded_file.txt')
#sftp_client.chdir("/home/ec2-user")
#print(sftp_client.getcwd())
#sftp_client.get('demo.txt','C:\\Users\\Automation\\Desktop\\download_file.txt')
sftp_client.put("transfer_files.py",'/home/ec2-user/transfer_files.py')
sftp_client.close()
ssh.close()
[((2, 6, 2, 26), 'paramiko.SSHClient', 'paramiko.SSHClient', ({}, {}), '()', False, 'import paramiko\n'), ((3, 32, 3, 56), 'paramiko.AutoAddPolicy', 'paramiko.AutoAddPolicy', ({}, {}), '()', False, 'import paramiko\n')]