• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

How To Fix Warning: Remote Host Identification Has Changed

Bhagwad Park

Published on: July 12, 2023

Categories: Linux Command Line, VPS Hosting, Website Security 0

The “Warning: Remote Host Identification has Changed” message appears when you try and connect over SSH to a remote server, and there’s a mismatch between the server’s public key and what’s stored on your local machine.

In this article, I’ll explain how to replicate the error, what it means, how to fix it in both PowerShell and PuTTY, and when to worry.

Table of Contents
  • When Does “Warning: Remote Host Identification has Changed” Error Occur?
  • Priority #1: Ensure That It’s Not A Security Breach
  • How To Fix The “Warning: Remote Host Identification Has Changed” Message
    • How To Fix The Error On Windows PowerShell
    • How To Fix The Error On PuTTY
  • Conclusion

When Does “Warning: Remote Host Identification has Changed” Error Occur?

For the “Warning: Remote Host Identification has Changed” message to appear, the following conditions must be met:

  1. You need to have connected to a certain remote server at a specific IP address before
  2. Either the server’s public key needs to have changed, or the key stored on your local system has changed, or you’re actually connecting to a completely different server (the most dangerous)

If both of these connections are met, you’ll see the error message.

Priority #1: Ensure That It’s Not A Security Breach

First, before you try and fix this problem ensure that you’re connecting to the right server. If you’re the root user of the VPS and you’ve verified that it’s the same VPS, then you don’t need to worry. If, on the other hand, if you’re connecting into someone else’s VPS (say an office VPS), then you should contact the VPS administrator and ask them to verify that the IP address of the VPS hasn’t changed. This error exists for a reason, and it could be the result of what we call a “Man-in-the-Middle” attack.

But there are other reasons why the error can occur even in a non-malicious environment. And that’s why you need to know how to fix it.

How To Fix The “Warning: Remote Host Identification Has Changed” Message

Once you’ve assured yourself that this isn’t a man-in-the-middle attack, it’s time to fix the error. Some SSH clients like PuTTY will warn you and let you connect, either once or permanently. Others like PowerShell on Windows simply won’t let you proceed. Here’s how to identify and fix the error message with both of these tools.

How To Fix The Error On Windows PowerShell

If you’re getting the error on Windows PowerShell, it’ll look something like this:

Warning: Remote Host Identification has Changed on PowerShell
Warning: Remote Host Identification has Changed on PowerShell

As you can see, the tool doesn’t allow you to proceed further. This means that if PowerShell is your only means of accessing SSH to your server, then you need a fix pronto!

To fix this error, you need to locate the “known_hosts” file on Windows. As of Windows 11, click the Windows Start button and type in the following:

%USERPROFILE%

This will bring you to your profile folder. Here, you need to enable the viewing of hidden folders. To do this, click the three dots on the top of the folder and click “Options”. In the following dialog box, click “View” as shown here:

Folder Options to View Hidden Folders
Folder Options to View Hidden Folders

In the list of settings below, click “Show hidden files, folders, or drives”. This will enable you to see things that Windows normally doesn’t show you. Specifically, files and folders that begin with a dot (.). Once this is enabled, you will be able to see a new folder in the %USERPROFILE% folder called “.ssh”. Open it, and you should see an entry called “known_hosts”.

Open this file in an editor and you’ll see a number of entries, each belonging to a specific IP address. Delete the lines that correspond to the IP address of the VPS to which you’re trying to log in and save your changes. This will reset the configuration of the SSH connection and make it look as if you’re connecting to your VPS via PowerShell for the first time.

After deleting the lines and saving your changes, try connecting to your VPS once again using PowerShell. This time, it should work.

How To Fix The Error On PuTTY

More than PowerShell, however, PuTTY is the most popular Windows client used to connect to VPS servers via SSH. More than PowerShell, however, PuTTY is the most popular Windows client used to connect to VPS servers via SSH. The “Remote Host Identification has Changed” warning doesn’t display in the same way on PuTTY as it does on PowerShell, but the basic concept is the same. The procedure for fixing the issue on PuTTY is different, though because PuTTY stores its keys, not in a file like PowerShell, but in the registry.

When you connect to a VPS server over SSH using PuTTY for the first time, you see the following message:

First Time Connecting to PuTTY
First Time Connecting to PuTTY

As you can see, PuTTY recognizes that the server’s public key isn’t stored in the registry, and for new servers, it stores it in the following location:

Computer\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys

For Windows users, you can find this location by pressing the “Start” key or opening the Start menu and typing “Regedit”. After bypassing the security warning, paste the above location into Regedit’s address bar. You should see something like this:

Find the Key that Corresponds to your Servers
Find the Key that Corresponds to your Servers

Each of these entries corresponds to a certain server at a specific IP address. The information in the registry is presented in a key/value format. The “Key” is on the left-hand side, each of which is for a specific server. The “Value” is the “Data” column containing the server’s public key. It’s important to note, that PuTTY stores the server key in a different format from how the server stores it, so the two won’t look the same. Your server stores the keys in the OpenSSH format, whereas PuTTY stores them in the “.ppk” format.

PuTTY includes a utility called PuTTYGen which allows you to convert the formats back and forth from one another. Here’s the link to download the latest versions of both PuTTYGen and PuTTY. You should keep both these programs handy for operations like this, even if you don’t need the tools immediately.

If your server’s public key changes, PuTTY won’t recognize the server, and will display a message like this:

PuTTY Error
PuTTY Error

The scary warning should alert you that something’s wrong. Unlike with PowerShell, however, PuTTY allows you to connect to the server either temporarily – via the “Connect Once” button – or permanently update the key in the registry using the “Accept” button. Take heed of PuTTY’s advice in the last line – Pressing “Cancel” is the ONLY guaranteed safe choice!

In general, I prefer PuTTY to Windows PowerShell for connecting via SSH, because it lets you save various configurations in a GUI format, and as you can see, key management is easier, with PuTTY giving you more options.

Conclusion

The “Warning: Remote Host Identification has Changed” message is a crucial part of the security architecture, that allows you to detect malicious man-in-the-middle attacks, and can save you from compromising your login information. However, most of the time it’s because something has changed on the origin server – either someone has re-installed the SSH package, or reconfigured it, or installed a new version of the OS. In such situations, simply getting rid of the public key stored on your local machine is enough to solve the problem. As shown above, you can do with automatically with PuTTY, or manually with PowerShell.

Whichever method you choose, make sure that you verify that the server is the same!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

How to Use Bash Getopts to Pass Arguments to Scripts

If you want to encapsulate some logic in a bash script, you must use bash getopts to process the script arguments

All About Bash Parameter Expansion

Parameter expansion in bash is very useful when working with strings like filenames and log entries. It allows you to clean up text.

Dealing with Cron Job Logs in Linux

Cron job logs keep track of which cron jobs run, and their details. This helps with troubleshooting and performance management.

How to Use the Tee Command in Linux

The tee command in Linux is useful when you want to direct the output of a command to multiple locations. Here's how to use it.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA