How to Fix “Host Key Verification Failed” Error in Proxmox

Proxmox logo

The “Host key verification failed” error is a common one when working with SSH-based systems like Proxmox. It happens when the host key SSH gets from the remote server no longer matches the one stored in your known hosts file. Usually this is because the server’s key genuinely changed, after a reinstall, an IP address change, or a security update, and SSH is warning you rather than silently connecting. This guide covers how to clear the error and reconnect safely.

One thing worth saying up front: this error exists to protect you. It’s the same warning you’d see if someone were impersonating your server, so before clearing a key, make sure you actually know why it changed. If a server you didn’t touch suddenly has a new key, stop and investigate rather than clearing it out of habit.

Step 1: Confirm the Cause

Try connecting to the server that triggered the error and read the message carefully. It will tell you which host key changed and point to the offending line in your known hosts file:

ssh [email protected]

Step 2: Remove the Old Host Key

Once you’re satisfied the change is legitimate, remove the stale key from your known hosts file using ssh-keygen with the -R option and the server’s IP or hostname:

ssh-keygen -R 192.168.1.110

This drops the old entry for that server, leaving the rest of your known hosts untouched.

Step 3: Reconnect and Accept the New Key

Connect again, and SSH will fetch the updated host key and ask you to confirm it. Type yes to accept and store it:

ssh [email protected]

From here the connection works as normal, and you won’t be prompted again unless the key changes once more.

Step 4: Do It in One Step (Optional)

If you manage a system-wide known hosts file and want to remove the old key and reconnect in a single command, you can chain the two together:

ssh-keygen -f "/etc/ssh/ssh_known_hosts" -R "hostname_or_ip" && ssh -o "HostKeyAlias=alias" username@hostname_or_ip

Replace hostname_or_ip with the server’s address, alias with a host key alias if you use one, and username with your SSH user. This is handy when scripting the fix across several servers at once.

Related guides


Comments

One response to “How to Fix “Host Key Verification Failed” Error in Proxmox”

  1. Rachel Kim Avatar
    Rachel Kim

    The author did a wonderful job of simplifying complex ideas. I am constantly impressed by the utility of this website.

Leave a Reply

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