Guest User

Untitled

a guest
Aug 21st, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import paramiko
  2.  
  3. # setup ssh connection this works. no problem.
  4. ssh = paramiko.SSHClient()
  5. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  6. conn = ssh.connect(MACHINEIP, username=ROOTUSER, password=ROOTUSER_PASSWORD, port=22)
  7.  
  8. # This first ssh exec works perfect.
  9. (sshin1, sshout1, ssherr1) = ssh.exec_command(cmd1)
  10.  
  11. # When I print the output of 2nd and 3rd ssh exec, I get output saying of channel open
  12. (sshin2, sshout2, ssherr2) = ssh.exec_command(cmd2)
  13. print sshout2
  14. (sshin3, sshout3, ssherr3) = ssh.exec_command(cmd3)
  15. print sshout3
  16.  
  17. <paramiko.ChannelFile from <paramiko.Channel 2 (open) window=2097152
  18. -> <paramiko.Transport at 0x1d42bd0L (cipher aes128-ctr, 128 bits)
  19. (active; 1 open channel(s))>>>
  20.  
  21. <paramiko.ChannelFile from <paramiko.Channel 6 (open) window=2097152
  22. -> <paramiko.Transport at 0x1d42bd0L (cipher aes128-ctr, 128 bits)
  23. (active; 2 open channel(s))>>>
Add Comment
Please, Sign In to add comment