The task is as follows: execute the ssh -p 2356 root@192.168.43.98 echo OK , so that the ssh -p 2356 root@192.168.43.98 echo OK in ~ / .ssh.
since I connect for the first time, a notification should pop up:
The authenticity of host '[192.168.43.98]: 2356 ([192.168.43.98]: 2356)' can't be established. ECDSA key fingerprint is SHA256: c1zdKx4q0dVTg7WjhslTmYbXm2D4dX37me9u0Mm6B6A. Are you sure you want to continue connecting (yes / no)?
after which I have to enter "yes", and get known_hosts.
I try to organize it through subprocess on python:
import subprocess,time args = 'ssh -p 2356 root@192.168.43.98 echo OK'.split() go = subprocess.Popen(args,stdin=subprocess.PIPE,universal_newlines=True) time.sleep(1) go.stdin.write('yes\n') however, an error creeps in:
ssh_askpass: exec (/ usr / bin / ssh-askpass): Host key verification failed.
When I write it with my hands all the rules, and through the subprocess it asks for some kind of ssh-askpass. You do not need to enter a password, I just want to get prints. What did I do wrong, and how to fix it?