tomerfiliba / plumbum

Plumbum: Shell Combinators
https://plumbum.readthedocs.io
MIT License
2.8k stars 182 forks source link

SshMachine hangs forever if hostname mismatches the IP key #459

Open xNinjaKittyx opened 5 years ago

xNinjaKittyx commented 5 years ago

In scenarios where hostname key is correct, but the IP key is incorrect, plumbum doesn't spit an error, but instead hangs forever.

Warning: the ECDSA host key for 'myhostname' differs from the key for the IP address '192.168.1.123'
Offending key for IP in /root/.ssh/known_hosts:67
Matching host key in /root/.ssh/known_hosts:91
Are you sure you want to continue connecting (yes/no)?

In the scenarios where ssh key is incorrect or no key exists, it raises an exception (from what I remember...)

Slightly unrelated, but if there's a way to not use an identity file (yes I understand the risks), I would like to know this as well.