Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect('10.100.102.2', port=2222, username='*****', password='*******')
- ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command('ls -1 /root|head -n 5')
- ssh_session = ssh.get_transport().open_session()
- if ssh_session.active:
- ssh_session.exec_command('ls -1 /root|head -n 5')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement