asyncssh icon indicating copy to clipboard operation
asyncssh copied to clipboard

Equivalent of UserKnownHostsFile=/dev/null

Open acerv opened this issue 6 months ago • 2 comments
trafficstars

Hi Devs,

I'm currently developing kirk SSH support using asyncssh. In particular, I would like to know what's the equivalent of ssh -o UserKnownHostsFile=/dev/null, so I can resolve the following issue: https://github.com/linux-test-project/kirk/issues/51 .

Thanks in advance, Andrea

acerv avatar May 19 '25 07:05 acerv

You can pass in known_hosts=None if you want to completely disable known host checking. However, this is not recommended for security reasons, as it allows a man-in-the-middle attack.

If you are looking for AsyncSSH to prompt the user about whether to trust the host key or not, that's something you would need to build into your application. AsyncSSH intentionally avoids ever writing to SSH config or known hosts files or prompting the end-user for input. It is meant to act as a library, with all such user interactions being the application's responsibility.

ronf avatar May 19 '25 13:05 ronf

Thank you very much!

acerv avatar May 19 '25 13:05 acerv