Remote Host Identification Has Changed Error When Using SSH_Exec(OpenSSH).vi in LabVIEW

Updated Apr 5, 2023

Reported In

Software

  • LabVIEW

Other

  • OpenSSH

Issue Details

I'm trying to send a command to a server through OpenSSH using SSH_Exec(OpenSSH).vi included in NI_SSH.lvlib. All the required inputs are set correctly, but I received this error:

[user@hostname ~]$ ssh root@user

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could be eavesdropping on you right now (man-in-the-middle attack)!

It is also possible that a host key has just been changed.

The fingerprint for the RSA key sent by the remote host is

xx:xx:xx.

Please contact your system administrator.

Add correct host key in /home/hostname /.ssh/known_hosts to get rid of this message.

Offending RSA key in /var/lib/sss/pubconf/known_hosts:4

RSA host key for user has changed and you have requested strict checking.

Host key verification failed.

 

How can I fix this?

Solution

The warning remote host identification error typically occurs when the unique fingerprint of your server does not match what was stored in C:\Users\username\.ssh\know_hosts when you first connected. It happens when you have changed your root password or rebuilt your VPS server. SSH has no way of knowing whether you've changed the server it connects to, or a server-in-the-middle has been added to your network to sniff on all your communications.

In order to solve this, it is needed to simply remove the key from known_hosts by deleting the relevant entry using PowerShell or PuTTY and running the command ssh-keygen -R hostname, this will update the key of your host.

After this, it will be needed to store the host key again, in order to accomplish this, it is needed to follow the steps described on Host Key Verification Failed When Using SSH_Exec(OpenSSH).vi - NI.