Ask Your Question
3

SSH Access Permission denied

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

Brenne gravatar image

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

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 http://cloud-images.ubuntu.com/precise/current/ . 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 - __init__.py[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

Comments

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

Sascha Vogt gravatar imageSascha Vogt ( 2014-01-14 10:57:55 -0500 )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 -0500 )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 -0500 )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 -0500 )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 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

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

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

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

This link also helps: http://docs.openstack.org/user-guide/...

Thanks..!!

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

[hide preview]

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 2,225 times

Last updated: Mar 18