1
votes

I try to use ssh to login in the Openstack server built for the class. I download the .pem key from server. By putty, I login successfully with .ppk key (generate .ppk key by .pem using putty keygen). But it's not work on ssh. Is there something I missed?

My command

ssh -l ubuntu -i ~/.ssh/xxx.pem xxx.edu -p 18922

Error msg

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
(xxx).
Please contact your system administrator.
Add correct host key in /Users/xxx/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/xxx/.ssh/known_hosts:2
RSA host key for [xxx.edu]:18922 has changed and you have requested strict checking.
Host key verification failed.
1
What ssh are you using? My guess is it's openssh, which I don't believe supports .pem format keys... - twalberg
I use default ssh of OSX. So how can I login with private key? - user2174595
You'll need to find a way to convert the .pem formatted key into a format that ssh understands. ssh-keygen may be able to do it, or something from the openssl suite. I don't have a specific solution off the top of my head; perhaps someone else will. - twalberg
can you try is after removing the second key from /Users/xxx/.ssh/known_hosts file. I think it will resolve this error. - Anil Vishnoi
@AnilVishnoi Thanks a lot. It works. - user2174595

1 Answers

1
votes

Thanks for Anil Vishnoi's comment!

Remove

/Users/xxx/.ssh/known_hosts

and use my original command by passing pem key

ssh -l ubuntu -i ~/.ssh/xxx.pem xxx.edu -p 18922

I can ssh to Openstack server directly.