I'm using paramiko to ssh into a server and then from this server ssh into another one just to get the fingerprint, so I'd like to see the message that asks if I want to accept that fingerprint or no.
I'm using this code:
stdin,stdout,stderr = self.ssh.exec_command(command)
outlines = stdout.readlines()
resp = ''.join(outlines)
return resp
but it returns me nothing. I think it's because at some point the ssh command wait for me to input yes/no if I want to accept the fingerprint. I did man ssh
and didn't find a way to automatically answer no
for this question.
I've found this: Reading output of Top command using Paramiko which teaches how to invoke a shell. But what if I want to receive the text just up to the stopping point?