Advertisement
Guest User

Untitled

a guest
Mar 14th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. def ssh2(username, password, hostname):
  2. if __name__ == '__main__':
  3. paramiko.util.log_to_file('paramiko.log')
  4. ssh = paramiko.SSHClient()
  5. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  6. ssh.connect(hostname = hostname, username = username, password = password)
  7. cmd = './tmp/batch_ping_dce.bat'
  8. stdin,stdout,stderr = ssh.exec_command(cmd,timeout = 10)
  9. print stdout.read()
  10. ssh.close()
  11.  
  12. DEB [20160315-10:53:26.700] thr=1 paramiko.transport: starting thread (client mode): 0x2b3acc0L
  13. DEB [20160315-10:53:26.700] thr=1 paramiko.transport: Local version/idstring: SSH-2.0-paramiko_1.16.0
  14. DEB [20160315-10:53:26.809] thr=1 paramiko.transport: Remote version/idstring: SSH-2.0-OpenSSH_6.1
  15. INF [20160315-10:53:26.809] thr=1 paramiko.transport: Connected (version 2.0, client OpenSSH_6.1)
  16. DEB [20160315-10:53:26.855] thr=1 paramiko.transport: kex algos:[u'ecdh-sha2-nistp256', u'ecdh-sha2-nistp384', u'ecdh-sha2-nistp521', u'diffie-hellman-group-exchange-sha256', u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server key:[u'ssh-rsa', u'ssh-dss', u'ecdsa-sha2-nistp256'] client encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'arcfour256', u'arcfour128', u'aes128-cbc', u'3des-cbc', u'blowfish-cbc', u'cast128-cbc', u'aes192-cbc', u'aes256-cbc', u'arcfour', u'rijndael-cbc@lysator.liu.se'] server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'arcfour256', u'arcfour128', u'aes128-cbc', u'3des-cbc', u'blowfish-cbc', u'cast128-cbc', u'aes192-cbc', u'aes256-cbc', u'arcfour', u'rijndael-cbc@lysator.liu.se'] client mac:[u'hmac-md5', u'hmac-sha1', u'umac-64@openssh.com', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-ripemd160', u'hmac-ripemd160@openssh.com', u'hmac-sha1-96', u'hmac-md5-96'] server mac:[u'hmac-md5', u'hmac-sha1', u'umac-64@openssh.com', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-ripemd160', u'hmac-ripemd160@openssh.com', u'hmac-sha1-96', u'hmac-md5-96'] client compress:[u'none', u'zlib@openssh.com'] server compress:[u'none', u'zlib@openssh.com'] client lang:[u''] server lang:[u''] kex follows?False
  17. DEB [20160315-10:53:26.855] thr=1 paramiko.transport: Kex agreed: diffie-hellman-group1-sha1
  18. DEB [20160315-10:53:26.855] thr=1 paramiko.transport: Cipher agreed: aes128-ctr
  19. DEB [20160315-10:53:26.855] thr=1 paramiko.transport: MAC agreed: hmac-sha2-256
  20. DEB [20160315-10:53:26.855] thr=1 paramiko.transport: Compression agreed: none
  21. DEB [20160315-10:53:26.917] thr=1 paramiko.transport: kex engine KexGroup1 specified hash_algo <built-in function openssl_sha1>
  22. DEB [20160315-10:53:26.917] thr=1 paramiko.transport: Switch to new keys ...
  23. DEB [20160315-10:53:26.934] thr=2 paramiko.transport: Adding ssh-rsa host key for 172.17.2.33: 377447af08a1f74e1c25582050e20d83
  24. DEB [20160315-10:53:27.137] thr=1 paramiko.transport: userauth is OK
  25. INF [20160315-10:53:31.980] thr=1 paramiko.transport: Authentication (password) successful!
  26. DEB [20160315-10:53:31.996] thr=2 paramiko.transport: [chan 0] Max packet in: 32768 bytes
  27. DEB [20160315-10:53:31.996] thr=1 paramiko.transport: [chan 0] Max packet out: 32768 bytes
  28. DEB [20160315-10:53:31.996] thr=1 paramiko.transport: Secsh channel 0 opened.
  29. DEB [20160315-10:53:32.059] thr=1 paramiko.transport: [chan 0] Sesch channel 0 request ok
  30. DEB [20160315-10:53:44.214] thr=1 paramiko.transport: EOF in transport thread
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement