Ask Your Question

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

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

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
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
RSA host key for 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 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

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- 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- 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
edit flag offensive delete link more

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


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

Seen: 1,499 times

Last updated: Oct 24 '14