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@ 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

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

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


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

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

Get to know Ask OpenStack

Resources for moderators

Question Tools


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

Seen: 365 times

Last updated: Jul 05 '17