Guest User

Untitled

a guest
Mar 10th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. ip='192.168.105.8'
  2. port=22
  3. username='xyz'
  4. password='abc'
  5. ssh=paramiko.SSHClient()
  6. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  7. ssh.connect(ip,port,username,password)
  8. print ("SSH connection established")
  9.  
  10. stdin,stdout,stderr=ssh.exec_command('sudo fast.sh')
  11. outlines=stdout.readlines()
  12. outlines+=stderr.readlines()
  13. resp=''.join(outlines)
  14. print(resp)
Add Comment
Please, Sign In to add comment