Ecdsa-sha2-nistp256 host key mismatch

Happy new year to all,
I installed a fresh xubuntu to my computer. Before fresh xubuntu I can connect ssh to my old xubuntu from my vera. But with fresh one I cannot connect from my vera. It says;

root@MiOS_50000000:~# ssh 192.168.4.61

ssh: Connection to root@192.168.4.61:22 exited:

ecdsa-sha2-nistp256 host key mismatch for 192.168.4.61 !
Fingerprint is sha1!! 95:62:ae:23:56:f1:de:00:4e:f5:03:aa:52:08:e1:0a:4a:2d:d1:a6
Expected

What Should I do?

Remove any entry(-ies) for 192.168.4.61 from your known_hosts file (often ~/.ssh/known_hosts), then try again. It should say the authenticity of the host can’t be established, show you the fingerprint, and ask you if it’s OK (to which you should answer yes).

Already remove keys but not succeed (stop ssh then restart ssh again) then uninstall then install open ssh again but still not succeed. known_hosts both user and root is emty but connection is not still possible.(ecdsa-sha2-nistp256 host key mismatch for 192.168.4.61 !)

What is the precise paths of the known_hosts files you’ve checked?

C

/home/xubu/.ssh/known_hosts
/root/.ssh/known_hosts

On the Vera box? I have some odd memory that the known_hosts for Mios is somewhere else but can’t recall where. Or I could just be wrong.

Try ssh -y
or -y -y

Just to check

C

/home/xubu/.ssh/known_hosts and /root/.ssh/known_hosts are at the PC not at vera box

By the way I can ssh connection from my vera to another host like 192.168.4.55 but when I try to ssh from my vera to 192.168.4.61 it gives me same error;
root@MiOS_50000000:~# ssh 192.168.4.61

ssh: Connection to root@192.168.4.61:22 exited:

ecdsa-sha2-nistp256 host key mismatch for 192.168.4.61 !
Fingerprint is sha1!! 95:62:ae:23:56:f1:de:00:4e:f5:03:aa:52:08:e1:0a:4a:2d:d1:a6
Expected

I install fresh xubuntu again a hour ago but nothing changed. It seems something wrong at vera box but what is?

There is two files in /etc/dropbear at vera box. These are “dropbear_ecdsa_host_key” and “dropbear_rsa_host_key”. Should I erease them or something else?

This is from your Vera, you need to check the known_hosts on Vera…

C

Where is the paths of the known_hosts at vera?

Try /root/.ssh/known_hosts

See if 192.168.4.61 is listed in there. If so delete that entry (or entries) and try again

C

1 Like

A simple thank you can not express my feelings but I cannot do anything else with text. Thank you very very much, your guidance solve my problem.

1 Like

No problem at all, sir. Happy to have helped.

You put a lot of effort into a simple issue, unfortunately :frowning:

Glad it’s working now, though :slight_smile:

Happy New Year!

C

I am not complaining, I am newbie about linux stuffs. Those issues help me to understand linux logic. :smiley:

1 Like

It’s the way I learned. For a newbie you did well. I assume you were using command line, ssh and some kind of editor like vi or nano. Many would have failed at the lack of a GUI…

C

Yes, I use all from terminal. I make a scene that vera shout down my xubuntu pc with os.execute(" ssh -y -i ~/.ssh/id_rsa root@192.168.4.61 sudo /sbin/poweroff" )

1 Like

You could probably simplify that. You should be able to run just:

ssh root@192.168.4.61 /sbin/poweroff once you get everything sorted out.

But it’s generally regarded as bad practice to have ssh for root enabled. And when I say ‘generally’ and ‘bad practice’ it’s more like 'you should really not have root able to log in by ssh. It makes hacking your system a lot simpler if you already know the username…

Been a long time since I saw a Linux distro that had sshd configured to allow root login.

What I suspect you’ll end up with is more like

ssh username@192.168.4.61 ‘sudo /sbin/poweroff’

Cheers

C

is not work only only root make the script work. :thinking:

Is your user on the ubuntu box able to sudo commands? It’s a real security risk having SSH accept login from root.

Googling should help. You’re not the first person to drive and solve this issue :wink:

C

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy