Created
April 8, 2017 07:39
-
-
Save ktechmidas/c37e98a0beb65e281628c26110f665f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERR [20170407-19:12:19.894] thr=134 paramiko.transport: Traceback (most recent call last): | |
ERR [20170407-19:12:19.894] thr=134 paramiko.transport: File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1749, in run | |
ERR [20170407-19:12:19.894] thr=134 paramiko.transport: self._check_banner() | |
ERR [20170407-19:12:19.894] thr=134 paramiko.transport: File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1897, in _check_banner | |
ERR [20170407-19:12:19.894] thr=134 paramiko.transport: raise SSHException('Error reading SSH protocol banner' + str(e)) | |
ERR [20170407-19:12:19.894] thr=134 paramiko.transport: SSHException: Error reading SSH protocol banner | |
ERR [20170407-19:12:19.894] thr=134 paramiko.transport: | |
DEB [20170407-19:12:22.458] thr=3 paramiko.transport: Received global request "[email protected]" | |
DEB [20170407-19:12:22.458] thr=3 paramiko.transport: Rejecting "[email protected]" global request from server. | |
----------- | |
def simple_ssh(ip,runcmd): | |
paramiko.util.log_to_file("ssh.log") | |
k = paramiko.RSAKey.from_private_key_file('/root/cluster/ibb-korea.pem') | |
ssh=paramiko.SSHClient() | |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
try: | |
ssh.connect(ip,username='core',pkey = k) | |
stdin,stdout,stderr = ssh.exec_command(runcmd) | |
except: | |
print "Failed to connect" | |
return 10 | |
time.sleep(3) | |
return stdout.readlines() | |
----------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment