{"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-03-16T12:12:03","modified_gmt":"2026-03-16T12:12:03","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 class=\"no-margin\">If you are trying to connect to a remote server using SSH and encounter the &ldquo;Host key verification failed&rdquo; or the &ldquo;Remote host identification has changed&rdquo; warning, it indicates that <b>your SSH client cannot verify the authenticity of the host<\/b> you are connecting to. <\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Although it may look like a severe issue due to the nature of the warning, one of the most common reasons is not related to an attack: this usually happens whenever you have <b><a href=\"\/support\/4965922-how-to-change-the-operating-system-for-your-vps\" target=\"_blank\" class=\"intercom-content-link\">changed the OS<\/a><\/b> on your VPS, if you <b>reinstalled the OS<\/b> or changed the <b>root user password<\/b>.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">To fix it, follow these steps:<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_0297523d2f\">Step 1 &ndash; Remove the Entry From the known_hosts File<\/h2><p class=\"no-margin\">When you first connected to your VPS via SSH, a host key was added to the <b>known_hosts<\/b> file on your local device. Now, after changing or reinstalling your OS, this entry is outdated and <b>needs to be removed<\/b>. You can do so by entering the following command on the Terminal:<\/p><p class=\"no-margin\">\n<\/p><pre><code>ssh-keygen -R [vps-ip]<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Make sure to replace <b>[vps-ip]<\/b> with <b><a href=\"\/support\/5139756-how-to-find-vps-ip\" target=\"_blank\" class=\"intercom-content-link\">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><p class=\"no-margin\">\n<\/p><h2 id=\"h_8561a45871\">Step 2 &ndash; Connect to the Server<\/h2><p class=\"no-margin\">Now that the old entry is removed try <b><a href=\"\/support\/5723772-how-to-connect-to-your-vps-via-ssh\" target=\"_blank\" class=\"intercom-content-link\">connecting to your VPS again using SSH<\/a><\/b>. This time,<\/p><p class=\"no-margin\">you should be able to verify the host key and connect without issues.<\/p><p class=\"no-margin\">\n<\/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>\n","protected":false},"excerpt":{"rendered":"<p>Fixing failed verification error when connecting via SSH to your VPS<\/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":0,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/683\/revisions"}],"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}]}}