Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. ssh = paramiko.SSHClient()
  2. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  3. ssh.connect('10.100.102.2', port=2222, username='*****', password='*******')
  4. ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command('ls -1 /root|head -n 5')
  5. ssh_session = ssh.get_transport().open_session()
  6. if ssh_session.active:
  7. ssh_session.exec_command('ls -1 /root|head -n 5')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement