Ask Your Question
1

Not able to SSH to newly created instance with .pem key

asked 2017-07-04 09:07:19 -0500

VivSam gravatar image

Hi I have created a new instance using heat and generated the keypair using following command openstack keypair create KEY_NAME > MY_KEY.pem

now when i am trying to ssh to my new instance using below command

ssh -i /root/ELK.pem cloud-user@10.190.189.196 am getting the error Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

my heat template sample looks like below

key_name: type: string label: ELK

should i pass path name in the label or should i pass it in the parameters?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2017-07-04 14:51:54 -0500

updated 2017-07-04 14:53:35 -0500

The instance retrieves the public key when it starts up, so you need to create the keypair and the private key in the pem file before launching the instance.

Perhaps I don't quite understand HOT syntax, but according to the Heat resource reference, you should write

key_name: ELK

You can also look for cloud-init error messages in the instance's console log openstack console log show.

edit flag offensive delete link more
1

answered 2017-07-05 04:38:47 -0500

VivSam gravatar image

I figured the default user name is "ec2-user" once you create the instance. Should have been using

ssh -i /path-to-key/.pem ec2-user@host

.

edit flag offensive delete link more

Comments

Yes, unfortunately the user varies based on the guest image used.

sgordon gravatar imagesgordon ( 2017-07-05 10:31:56 -0500 )edit

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

Stats

Asked: 2017-07-04 09:07:19 -0500

Seen: 263 times

Last updated: Jul 05 '17