There is a way that we can connect a remote computer without password by using ssh-keygen.(for more info look at this)
In my problem, there is two computer (let's say computer A and B) and computer A can connect computer B without ssh password. When computer B's ip address is changed(but I don't know if new ip is really belong to it.), I am editing known_host file as replacing old ip with new one. If new ip is really belong to computer B, computer A can continue to connect without password so there is no problem. But if new ip is not belong to computer B, ssh asks password to connect computer B.
Since all above progress is performed by a python code, SSH is waiting for password and my program stops running if I tried to connect computer B. What I am trying to do is check if ssh asks password without entering password.
Is there any ssh options or any other way to do that?
commands(which has been deprecated for years in any case...)