SSH Access Permission denied

asked 2014-01-14 10:23:59 -0600

Brenne gravatar image

updated 2014-01-15 03:39:10 -0600

Hello, I have a VM with Ubuntu 12.04 and devstack up and running.
Now I want to create an ubuntu instance and ssh into it. I downloaded the current image from . I uploaded this image via the dashboard to openstack. Next I launched an instance based on this image with a keypair I created and added also via the dashboard before.
The instance is up. I can ping it and ssh seems also to be working but I always get the error Permission denied (publickey). If I view the log I see the instance creates ssh keypairs on the first boot. I also launched the instance via command line (nova boot) - same.

Before the instance creates ssh keypairs on first boot following warning occurs:

cloud-init start running: Wed, 15 Jan 2014 09:31:53 +0000. up 98.75 seconds
found data source: DataSourceConfigDrive [net,ver=2][source=/dev/sr0]
2014-01-15 09:31:57,082 -[WARNING]: Unhandled non-multipart userdata ''

Therefore I suppose my public key isn't pushed / injected into the instance with the help of cloud init. But I also tried to create the instance with nova boot and pass userdata (especially the ssh key) via the argument --user-data.

edit retag flag offensive close merge delete


Can you check that the keypair shows with the correct public key hash?

Sascha Vogt gravatar imageSascha Vogt ( 2014-01-14 10:57:55 -0600 )edit

According to the log the keypairs which are created on the first boot are different (i.e. public key is different). But - how far I understand it - it is enough when the public key, which I created, is in authorized_keys, isn't it? But I also don't now if this is the case :-(

Brenne gravatar imageBrenne ( 2014-01-14 14:29:58 -0600 )edit

I meant: If you check the public key fingerprint (e.g by loading the public key into puttygen) and compare it to the output of "nova keypair-list" - do they match? Also are you sure, you're using the right private key to the public key you added to Nova?

Sascha Vogt gravatar imageSascha Vogt ( 2014-01-15 02:12:51 -0600 )edit

The public key in my VM is the same to the output of nova keypair-list (compared wit ssh-keygen -l). Therfore I suppose that this public key isn't pushed/injected in the instance. I will edit my questions with futher details.

Brenne gravatar imageBrenne ( 2014-01-15 03:36:20 -0600 )edit

remove the line in known hosts file associated with your server IP address and regenerate your key. You may have to rebuild your instance and associate your new key with it.

jeffrey-olsen gravatar imagejeffrey-olsen ( 2015-01-11 22:20:08 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-03-18 15:29:56 -0600

Praveen N gravatar image

updated 2015-03-18 15:30:39 -0600

Hi, The keypair you have created and added to dashboard,this has been made used for the instance.Also the other way to go round this issue is to create a keypair in the dashboard directly and download the .pem file. Make use of this .pem file while ssh'ing to your instance like

ssh -i MyKey.pem ubuntu@

This link also helps:


edit flag offensive delete link more


when i try this is get Permission denied (publickey). error. Any solution for this?

sanjana gravatar imagesanjana ( 2017-05-10 00:49:40 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2014-01-14 10:23:59 -0600

Seen: 8,224 times

Last updated: Mar 18 '15