Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- sshclient = None
- try:
- sshclient = paramiko.SSHClient()
- sshclient.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- sshclient.connect('dm-j-9513-1', username='admin', password='admin1234')
- chan = sshclient.get_transport().open_session(window_size=500000)
- chan.settimeout(10800)
- chan.exec_command('show tech-support fcip')
- value = chan.recv(1024)
- while value:
- print(value)
- value = chan.recv(1024)
- finally:
- if sshclient:
- sshclient.close()
- Authentication (password) successful!
- [chan 0] Max packet in: 32768 bytes
- [chan 0] Max packet out: 32768 bytes
- Secsh channel 0 opened.
- [chan 0] Sesch channel 0 request ok
- EOF in transport thread
- Authentication (password) successful!
- [chan 0] Max packet in: 32768 bytes
- [chan 0] Max packet out: 32768 bytes
- Secsh channel 0 opened.
- [chan 0] Sesch channel 0 request ok
- [chan 0] EOF received (0)
- EOF in transport thread
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement