Ask Your Question
0

Error in ssh key pair log in

asked 2014-10-23 03:45:00 -0500

I am trying to login into VM from host using ssh key pair instead of password. I have created VM using keypair khayamkey and than tried to login into vm using following command

ssh -l tux -i khayamkey.pem 10.3.24.56

where tux is username for VM, but I got following error

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
52:5c:47:33:dd:d0:7a:cd:0e:78:8d:9b:66:d8:74:a3.
Please contact your system administrator.
Add correct host key in /home/openstack/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/openstack/.ssh/known_hosts:1
  remove with: ssh-keygen -f "/home/openstack/.ssh/known_hosts" -R 10.3.24.56
RSA host key for 10.3.24.56 has changed and you have requested strict checking.
Host key verification failed.

P.S: I know if I run ssh-keygen -f "/home/openstack/.ssh/known_hosts" -R 10.3.24.56 problem can be solved but than I have to provide password to log in to VM, but my goal is to use keypairs NOT password.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2014-10-24 00:04:07 -0500

Manoj Krishnan gravatar image

updated 2014-10-24 00:05:30 -0500

This error is because IP-10.3.24.56 key entry is already registered in the file ~/.ssh/known_hosts from which you try to login to openstack instances.

Try to clear the key entry of IP-10.3.24.56 in the ~/.ssh/known_hosts file and try to login to the instance or else try the following command.

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l tux -i khayamkey.pem 10.3.24.56
edit flag offensive delete link more
0

answered 2014-10-23 11:39:19 -0500

rahulrajvn gravatar image

updated 2014-10-23 11:39:40 -0500

First use the command you know to remove the warning message.

Then login in to the Vm using password and add the public key(of the private key U are using to login ) in to authorized.keys under the .ssh directory of corresponding user you like to login as.

You can automate this by configuring cloud-init in the templates so that once a new Vm is created cloud-init will automatically retrieve the keys and add to needed user.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-10-23 03:45:00 -0500

Seen: 1,317 times

Last updated: Oct 24 '14