#!/usr/bin/env python
import os
import paramiko
from scp import SCPClient
from paramiko import SSHClient
def main():
ssh = SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname='10.99.241.36', port=22, username='root', password='0penBmc')
stdin, stdout, stderr = ssh.exec_command('df')
print(stdout.read().decode())
ssh.close()
ssha = SSHClient()
ssha.load_system_host_keys()
ssha.connect(hostname='10.99.241.36', port=22, username='root', password='0penBmc')
with SCPClient(ssha.get_transport()) as scp:
scp.put('tiogapass-20180822055635.all.tar', '/tiogapass-20180822055635.all.tar')
scp.close()
ssha.close()
print 'Completed!'
if __name__ == "__main__":
main()