An SSH server's host key identifies the machine before you send a username or password. PuTTY on Windows can cache a verified host key so later connections to that server do not ask you to trust it again.

PuTTY displays a Security Alert when it has no cached key for the server. The fingerprint in that alert needs to match a reference obtained through a separate trusted channel, such as the server administrator, console access, or a secured deployment record; a fingerprint collected from the same untrusted connection cannot establish the server's identity.

Cached keys belong to the current Windows user and the server name or IP address together with its SSH port. A different hostname, an IP address in place of a name, or a different port can therefore produce another trust prompt even when the destination is the same machine.

Steps to accept and cache a host key manually in PuTTY:

  1. Launch PuTTY from Windows Search.
  2. Enter the server name or IP address in Host Name (or IP address) under Session.

    The pictured hostname ssh.example.net is an example; your connection needs your server's address.

  3. Set Port to the server's SSH port.

    The default is 22; the pictured server uses 22222.

  4. Click Open to start the SSH connection.
  5. Compare the fingerprint in PuTTY Security Alert with the server's trusted fingerprint for the same key type.

    The alert identifies the key type, such as ED25519, ECDSA, or RSA; fingerprints for different keys will not match.

    An unverified host key can bind this server address to an impostor and expose passwords or forwarded traffic. If the fingerprint does not match or cannot be verified, cancel the connection before entering credentials. A changed-key warning can mean a legitimate rebuild or key rotation, but it can also mean interception; a new key needs independent confirmation before replacing the cached one.

  6. Click Accept only when the fingerprint matches the trusted value.

    The Accept button saves the host key for later connections; Connect Once continues without caching it. Windows stores PuTTY's cached keys under HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys.

  7. Confirm the terminal reaches the login as: prompt.

    The host-key check finishes before account authentication; no username or password is needed to check that the key was accepted.

  8. Close the PuTTY terminal with its window close button.
  9. Click OK in PuTTY Exit Confirmation.
  10. Launch PuTTY again from Windows Search.
  11. Enter the same server name or IP address in Host Name (or IP address).
  12. Set Port to the same SSH port used for the first connection.
  13. Click Open to reconnect to the server.
  14. Confirm the new session reaches login as: without a PuTTY Security Alert.
Share this guide