Raspberry Pi

How to Fix Host Key Verification Failed Error for Raspberry Pi Remote Access

Raspberry Pi is a single-board computer that can be remotely accessed through a terminal on another PC or laptop using the “ssh pi@IP” command. However, Raspberry Pi users encounter a “Host key verification failed” error while accessing the terminal on their system. The error mainly occurs when you again access the terminal on your system after the first login attempt.

If you have experienced the same error while accessing the Raspberry Pi terminal from Command Prompt, follow this article to learn how to fix it.

Fix Host Key Verification Failed Error on Raspberry Pi Remote Access

Most people use the simple approach to access the Raspberry Pi terminal remotely on Command Prompt using the following command:

$ ssh pi@IP-Address

Though they manage to access the terminal for the first time without an error, however, for the second time, they may encounter the “Host key verification failed” error, which is shown below:

This error prevents Raspberry Pi users from logging in the system through Command Prompt and to fix this error, you must follow the below-given steps:

Step 1: Go to the “C:\Users” folder location on Windows PC or laptop.

Step 2: Select the user you are currently logged in to. In my case, it’s awaix. You can confirm your user here.

Step 3: Go to the “.ssh” folder.

Note: If you cannot see the “.ssh” folder, go to the “Hidden items” box through the “View” tab.

Step 4: Remove or rename the “known_hosts” file.

Once done, go to Command Prompt and enter the following command again:

$ ssh pi@IP-Address

Click “yes” to confirm adding the host.

Enter the Raspberry Pi password to access the terminal remotely.

Conclusion

The above guideline is useful to fix the host key verification failed error while accessing the Raspberry Pi terminal on Command Prompt. The users just have to delete or rename the “host” file inside the “.ssh” folder to successfully log in to Raspberry Pi using the SSH connection with username and password.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.