forked from mnielsen/ec2_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_python.py
More file actions
28 lines (26 loc) · 774 Bytes
/
test_python.py
File metadata and controls
28 lines (26 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
__author__ = 'Alexey'
print "NEW Hello World!!!"
# import paramiko
#
# host = 'poisknomera.ru'
# user = 'ec2-user'
# port = 22
# key_file='D:\\Documents\\Dropbox\\Backup\\AWS2013.pem'
#
# client = paramiko.SSHClient()
# client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
# client.connect(hostname=host, username=user, port=port, key_filename=key_file)
# stdin, stdout, stderr = client.exec_command('ls -l')
# data = stdout.read() + stderr.read()
# transport = client.get_transport()#.open_session()
#
# sftp = paramiko.SFTPClient.from_transport(transport)
# remotepath = './file.py'
# localpath = 'D:\\Projects\\ec2_tools\\test_ec2.py'
#
# # sftp.get(remotepath, localpath)
# sftp.put(localpath, remotepath)
#
# sftp.close()
# transport.close()
# client.close()