How to import a keypair?

Asked by Michael Lin

Dear all,

I have a big question...

Anyone can teach me how to import a keypair?

I don't know what kind of data need to insert into the column "public key" (by dashboard or python-novaclient)?

Thanks for your kindly help :D

Michael Lin 2012.05.21

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Mandar Vaze
Solved:
Last query:
Last reply:
Revision history for this message
Endre Karlson (endre-karlson) said :
#1

ssh-rsa <long random string> <optional descriptive string>

The format above.

Endre.

2012/5/21 Michael Lin <email address hidden>

> New question #197936 on OpenStack Compute (nova):
> https://answers.launchpad.net/nova/+question/197936
>
> Dear all,
>
> I have a big question...
>
> Anyone can teach me how to import a keypair?
>
> I don't know what kind of data need to insert into the column "public key"
> (by dashboard or python-novaclient)?
>
> Thanks for your kindly help :D
>
> Michael Lin 2012.05.21
>
> --
> You received this question notification because you are an answer
> contact for OpenStack Compute (nova).
>

Revision history for this message
Michael Lin (michael-lin) said :
#2

Dear Endre Karlson,

Thanks for your answer, but I still confuse >"<

What kind of data should I insert into <long random string> ?

And I only can use CLI to import keypairs?

I can't import keypair using dashboard?

Thanks a lot : )

Michael Lin 2012.05.21

Revision history for this message
Best Mandar Vaze (mandarvaze) said :
#3

Michael,

You need to have a ssh public key (As explained by Endre above)

If you already have a ssh keypair then :

run " cat ~/.ssh/id_rsa.pub" on unix terminal
You will see output as explained by Endre above.
Copy the entire output (unless off course there is an error) into clipboard and paste in the Edit Box titled "Public Key" (Part of Import Keypair" pop-up dialog on Openstack Dashboard) Give some name to this keypair, and click submit

If you do not have a ssh keypair then :
On linux machine you can run "ssh-keygen" command. If you are unfamiliar with this command then you can "man ssh-keygen" (Or look at http://www.manpagez.com/man/1/ssh-keygen/)
By default you can just execute "ssh-keygen" command and go with all defaults. (It is interactive command) At the end, two files id_rsa and id_rsa.pub will be created under ".ssh" folder in your home directory (Remember dot in the beginning)

Revision history for this message
Michael Lin (michael-lin) said :
#4

Thanks Mandar Vaze, that solved my question.

Revision history for this message
cjchand (cjchand) said :
#5

On a potentially related note, when entering a keypair name in the Dashboard, it appears to not like "@" (e.g.: <email address hidden>). It kept giving me the same error, despite having the correct key contents in the "public key" field.

Maybe that's obvious to most, but threw me off for a few minutes. Hope that helps!