{"id":683,"date":"2023-04-13T07:08:42","date_gmt":"2023-04-13T07:08:42","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2023\/04\/13\/7266279-how-to-fix-the-host-key-verification-failed-error\/"},"modified":"2026-05-11T11:42:14","modified_gmt":"2026-05-11T11:42:14","slug":"7266279-how-to-fix-the-host-key-verification-failed-error","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/7266279-how-to-fix-the-host-key-verification-failed-error\/","title":{"rendered":"How to fix the &#8220;Host key verification failed&#8221; error"},"content":{"rendered":"<p>The &ldquo;Host key verification failed&rdquo; error is a security feature of SSH. It occurs when the identification key (fingerprint) of the remote server you are trying to access has changed since your last connection. To protect you from &ldquo;man-in-the-middle&rdquo; attacks, SSH blocks the connection until the outdated key is updated or removed.<\/p><h2 id=\"h-the-quick-fix-using-the-ssh-keygen-command\">The quick fix: Using the ssh-keygen command<\/h2><p>The most efficient way to fix this error is to use the ssh-keygen tool to remove the outdated key for a specific IP address or domain.<\/p><ol>\n<li>Open your terminal (macOS\/Linux) or PowerShell (Windows).<\/li>\n<li>Run the following command, replacing [IP_ADDRESS] with your server&rsquo;s IP:\n<pre>ssh-keygen -R [IP_ADDRESS]<\/pre>\n<p>Make sure to replace <b>[vps-ip]<\/b> with <b><a class=\"intercom-content-link\" href=\"\/support\/5139756-how-to-find-vps-ip\" target=\"_blank\" rel=\"noopener\">the IP of your VPS<\/a><\/b>. This will create a backup copy of the <b>known_hosts<\/b> file and delete the host key entry associated with your VPS IP.<\/p><\/li>\n<li>The output will confirm that the known_hosts file has been updated. You can now try reconnecting.<\/li>\n<\/ol><p><img decoding=\"async\" class=\"alignnone size-full wp-image-10450\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-34.png\" alt=\"\" width=\"1027\" height=\"264\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-34.png 1027w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-34-300x77.png 300w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-34-1024x263.png 1024w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-34-768x197.png 768w\" sizes=\"(max-width: 1027px) 100vw, 1027px\" \/><\/p><h2 id=\"h-the-manual-fix-editing-the-known_hosts-file\">The manual fix: Editing the known_hosts file<\/h2><p>If the command above does not work, you can manually open and edit the storage file to remove the offending fingerprint.<\/p><ol>\n<li>Locate your known_hosts file:\n<ul>\n<li>Linux\/macOS:\n<pre>~\/.ssh\/known_hosts<\/pre>\n<\/li>\n<li>Windows:\n<pre>C:\\Users\\YourUsername\\.ssh\\known_hosts<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>Open the file with a plain text editor (like Notepad or Nano).<\/li>\n<li>Find and delete the entire line that starts with your server&rsquo;s IP address or hostname.<\/li>\n<li>Save the file and try <b><a class=\"intercom-content-link\" href=\"\/support\/5723772-how-to-connect-to-your-vps-via-ssh\" target=\"_blank\" rel=\"noopener\">connecting to your VPS again using SSH<\/a>.<\/b><\/li>\n<\/ol><h2 id=\"h-the-ignore-fix-troubleshooting-only\">The &ldquo;Ignore&rdquo; fix (Troubleshooting only)<\/h2><p>You can tell SSH to skip the strict key checking temporarily. Use this method only for debugging in a controlled environment.<\/p><pre>ssh -o StrictHostKeyChecking=no username@ip_address<\/pre><p><img decoding=\"async\" class=\"alignnone size-full wp-image-10451\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-35.png\" alt=\"\" width=\"1161\" height=\"530\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-35.png 1161w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-35-300x137.png 300w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-35-1024x467.png 1024w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/05\/2026-05-11_18-35-768x351.png 768w\" sizes=\"(max-width: 1161px) 100vw, 1161px\" \/><\/p><p class=\"no-margin\">If you are still unable to connect after following the steps above, you can try the following:<\/p><ul>\n<li>\n<p class=\"no-margin\">Verify that you are connecting to the correct IP address (or hostname)<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Ensure that your firewall is not blocking the connection<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Restart your local device or the VPS to reset the network settings<\/p>\n<\/li>\n<\/ul><p>The &ldquo;Host key verification failed&rdquo; error is a common part of VPS management, especially after re-installing an OS or changing server IPs. By using the ssh-keygen -R command, you can quickly refresh your local computer&rsquo;s security records and re-establish a secure connection to your Hostinger VPS.<\/p><p>&nbsp;<\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p><strong>Notes<\/strong>:<\/p>\n<ul>\n<li><strong>Gradual Rollout:<\/strong> This security feature is universal to all SSH connections.<\/li>\n<li><strong>Root Access<\/strong>: These fixes are applied on your local computer, so you do not need root access on the remote server to perform them.<\/li>\n<li><strong>Multiple Entries<\/strong>: If you connect to the same server via both IP and a domain name, you may need to run the ssh-keygen -R command for both addresses.<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to resolve SSH connection errors by updating or removing outdated server fingerprints from your local machine.<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[199],"tags":[],"class_list":["post-683","post","type-post","status-publish","format-standard","hentry","category-vps-management"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/7266279-how-to-fix-the-host-key-verification-failed-error\/","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/7266279-como-solucionar-el-error-host-key-verification-failed\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/7266279-comment-reparer-l-erreur-host-key-verification-failed\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/7266279-cara-memperbaiki-error-host-key-verification-failed\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/7266279-como-corrigir-o-erro-host-key-verification-failed\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=683"}],"version-history":[{"count":3,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/683\/revisions"}],"predecessor-version":[{"id":10452,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/683\/revisions\/10452"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}