Can't SSH between boxes for replication "Host key verification failed"

Status
Not open for further replies.

Stephen J

Dabbler
Joined
Feb 3, 2012
Messages
49
I am trying to set replication up between two boxes using the directions from the FreeNAS Guide. I followed the instructions and used ssh-keyscan to get the ssh key from the remote host. Insert that into /root/.ssh/authorized_keys. When I try and ssh from local to remote I get the following error.

[root@LOCALNAS] /# ssh root@172.19.0.238
buffer_get_ret: trying to get more bytes 4 than in buffer 0
buffer_get_string_ret: cannot extract length
key_from_blob: can't read key type
key_read: key_from_blob
failed
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
d0:4b:1e:87:92:fe:27:6b:c3:ba:a0:d1:dd:83:8a:72.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /etc/ssh/ssh_known_hosts:1
RSA host key for 172.19.0.238 has changed and you have requested strict checking.
Host key verification failed.

When I ssh from remote to local it just says the authenticity can't be established, do I want to continue. Then it asks for the user password and I am in. I can't find a difference. Both are setup to allow Password authentication in the ssh settings. The only thing that I see that is weird is that the ssh-keyscan of the remote host returns a different key than is in the /data/ssh/replication.pub file. But I have tried that key too with no luck. I tried the user I created and root and neither worked. I have saved the remote key to the /root/.ssh/known_hosts file like the message said, no worky. I tried disabling strict key checking for the remote host and that just gave me the the same error but says that Password and keyboard interactive authentication is disable and permission denied (publickey,password).

Anyone have any ideas?


Stephen
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
you moved the id_rsa.pub to your remote box right ( authorized_hosts). make sure you didn't move the private key, also the username / hostname has to be correct in the authorized_hosts file (you could substitute with *'s too)

I's definitely possible as I am doing rsync over ssh using freenas, both push and pull and everything works. so just a problem with either files or permissions.
 

Stephen J

Dabbler
Joined
Feb 3, 2012
Messages
49
Thanks for the reply Joshua.
So, if I used ssh-keyscan from each box to the other, would that give me the correct key or is the the replication.pub the correct key? In the authorized_hosts file, the instructions in the manual don't mention using the user name. How would this be structured?

replication@172.19.0.238 ssh-rsa
(------------key-------------)

Would that be the correct form?

Thanks again.
Stephen
 

Stephen J

Dabbler
Joined
Feb 3, 2012
Messages
49
Finally got them to connect. I deleted the /root/.ssh/known_hosts and let it regenerate and now it works.

Stephen
 

Stephen J

Dabbler
Joined
Feb 3, 2012
Messages
49
Oh and the first few lines of that error was because I had a carriage return after ssh-rsa in my authorized_key files.

Stephen
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
yeah, keys are always 1 line. common mistake everyone seems to do
 
Status
Not open for further replies.
Top