python - Get host key of an ssh server in base 64 -
i'm using paramiko , need host key of ssh server in base 64 following line:
key = paramiko.rsakey(data=base64.decodestring('...'))   does know of way either through mac os x terminal, in python script, or else find this? thanks
you can retrieve server's public key server itself, without having authenticate server.
import paramiko import socket import sys  arg in sys.argv[1:]:         sock = socket.socket()         sock.connect((arg, 22))         trans = paramiko.transport.transport(sock)         trans.start_client()         k = trans.get_remote_server_key()         # on machine, returns paramiko.rsakey         print k.get_base64()      
Comments
Post a Comment