首页 经验

PuTTY detects the discrepancy between the current host key and the one stored in its cache (registry)

时间: 2024-10-18 09:45:47

(部分内容来自网络,其真实性存疑,为了避免对您造成误导,请谨慎甄别。)


The message "the server host key does not match the key PuTTY has cached in the registry" occurs when the SSH server's host key changes, and PuTTY detects the discrepancy between the current host key and the one stored in its cache (registry). This is a security feature designed to prevent man-in-the-middle attacks. Here’s how you can resolve this issue:


Steps to Resolve the Host Key Mismatch in PuTTY


1. Verify the Host Key:

   - Contact the Server Administrator: Reach out to the administrator of the server you're trying to connect to and confirm the current host key. This is crucial to ensure that the server has not been compromised.

   - Check for Server Changes: If the server has been reinstalled or if its SSH keys were regenerated, this could cause a change in the host key.


2. Update PuTTY's Cached Host Key:

   - If you have confirmed that the host key change is legitimate, you can update or remove the cached entry in PuTTY:

     1. Launch PuTTY.

     2. Go to the Session configuration where you input the server's hostname.

     3. In the "Host Name" section, enter the server's IP or hostname.

     4. Click on "Open" to initiate a connection.

     5. You will see a security alert dialog showing the new host key. Review the key fingerprint carefully.

     6. If you confirm it’s valid, click "Yes" to accept it. PuTTY will save this key in its cache.


3. Removing Cached Host Key from the Registry:

   - If you wish to manually remove the cached key, follow these steps:

     1. Open the Registry Editor (Press Windows + R, type regedit, and hit Enter).

     2. Navigate to the following path:

       

        HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys

       

     3. Find the entry corresponding to the hostname of the server.

     4. Right-click on the entry and select Delete.

     5. Close the Registry Editor and restart PuTTY. 

     6. Try connecting again; you should now see the prompt to accept the new host key.


4. Avoiding Future Mismatches:

   - To minimize the chances of encountering this issue in the future, regularly check for updates or changes to your server configurations, especially if they involve SSH keys.

   - Ensure all administrators or users with access to the server are informed about any changes made to the SSH keys.


Important Notes


- Always ensure you verify the authenticity of the new host key before accepting it to avoid possible security risks. Accepting a spoofed host key can expose you to man-in-the-middle attacks.

- If you're unsure about the validity of the host key, do not proceed with the connection until you have confirmed its authenticity.


By following these steps, you can resolve the host key mismatch issue with PuTTY and connect to your SSH server securely.


上一个 怎么中断mysql连接 文章列表 下一个 mysql source file 乱码

最新

工具

© 2019-至今 适观科技

沪ICP备17002269号