How to add SSH known host to known host file on Windows?

19,164

PuTTY stores the known hosts in the Windows Registry. In the FAQ, they offer a Python script to convert an existing known_hosts file to a Windows .REG file, but adding to ~/.ssh/known_hosts won't add to the hosts that PuTTY trusts.

You can also add hosts individually by connecting via PuTTY and clicking Yes on the PuTTY Security Alert. To do this, either open the PuTTY GUI and fill out the required fields to connect, or invoke it from the command line: putty.exe username@hostname port

Share:
19,164

Related videos on Youtube

Dims
Author by

Dims

Software developer & Machine Learning engineer C/C++/Java/C#/Python/Mathematica/MATLAB/Kotlin/R/PHP/JavaScript/SQL/HTML/ LinkedIn: http://www.linkedin.com/in/dimskraft Telegram: https://t.me/dims12 I prefer fishing rod over fish.

Updated on September 18, 2022

Comments

  • Dims
    Dims over 1 year

    The known_hosts file does not look trivial. On Windows I see it contains hostname, ip address and some RSA key.

    On linux I see it contains several keys separated by bar.

    Who manages this file on Windows? How to add some host as "known" to this file on Windows?

    Can Putty do this? If Putty has some host as known, can I copy this host record from Putty database to ~/.ssh/known_hosts on Windows?

    • Martin Prikryl
      Martin Prikryl almost 8 years
      Why do you want to have known_hosts on Windows?
    • user
      user over 7 years
      For OpenSSH, ~/.ssh/known_hosts can contain hashed host names (this is controlled by the HashKnownHosts configuration directive). Hashed host names start with a | character. Other SSH clients may work differently.