Can't upload SSH key

Asked by Kemel Zaidan aka Legendario

I can't upload me SSH key to launchpad. I get this error message:

Invalid public key

Why is it invalid?

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
David Allouche
Solved:
Last query:
Last reply:
Revision history for this message
Tom Haddon (mthaddon) said :
#1

Are you sure you're uploading the public key and not the private key section? Typically the public key has a ".pub" extension, and is in plain text.

How did you generate the key?

Revision history for this message
David Allouche (ddaa) said :
#2

It could also help if you pasted the public key here, so we could see what the problem is.

Revision history for this message
Kemel Zaidan aka Legendario (kemelzaidan) said :
#3

I am sure it's the public key. Here it is:

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Og2jQV0mB9UR01BLQFzznwCdCA5j6x2byAp+8QuLVAlfD/priNZ1NjjpjP9g5PHybDMJl7ewe7Im2gqpq2JAWUhQBlYMvHdDWieS0fM7f+b53L0oYumdr476hCHbf36FIMmVZU1HATZ2+8AN27LOTuF9Z7q3wCbgJODVivjcsEXdeTyoRPDEQopjSaHZxA1/sAloBvhsZvJm3izg4AvwxRzwHCpcsZKPE9XhS/bxALXcj4hX/TIXGZO25LA5kGKSksU+5GVeqZ+nvY3Zr3A+Z3HQ9fCXl7L+F6BCTdyT/+CumHqMiC7S9NPRCSQq68V2zzMafTXf4vkQ3MpBSI0QQ== pc São Paulo

Revision history for this message
Best David Allouche (ddaa) said :
#4

I was able to import this key. It seems you need to include the comment part in your submission.

Revision history for this message
Kemel Zaidan aka Legendario (kemelzaidan) said :
#5

Thanks David Allouche, that solved my question.

Revision history for this message
JianminX (heidan) said :
#6

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20080310-bzr-launchpad.net"
AAAAB3NzaC1yc2EAAAABJQAAAIEAvqA2RtZyOq17uj/xUcQJS81BFugXYCsVx/Jk
3Zl45f59sJsbB8JFzZ7xCFsCZmv4fg8YWCGEIXun1KTNyE45NZwtUysFa1QyySrm
UWis7P5Qei7GkAknKi+MA4cafRFMJ1WA1jo54Pzjrde5HHnxr27ErFInDv7idGIt
HN0XwN0=
---- END SSH2 PUBLIC KEY ----

I cannot upload SSH key either. Please advise.

Revision history for this message
Kemel Zaidan aka Legendario (kemelzaidan) said :
#7

Try to copy and paste the ASCI content of the key on launchpad.

Revision history for this message
Fantix King (fantix) said :
#8

Jianmin Xue,
Please try with the comment part:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAvqA2RtZyOq17uj/xUcQJS81BFugXYCsVx/Jk
3Zl45f59sJsbB8JFzZ7xCFsCZmv4fg8YWCGEIXun1KTNyE45NZwtUysFa1QyySrm
UWis7P5Qei7GkAknKi+MA4cafRFMJ1WA1jo54Pzjrde5HHnxr27ErFInDv7idGIt
HN0XwN0= THE_COMMENT_PART_HERE

Good luck.

Revision history for this message
Simon L'nu (simon-lnu) said :
#9

My pub key has no comment section... LP keeps telling me it's invalid. Funny that ssh-agent thinks it's perfectly valid.

Here's the thing in question:

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAYEAtxxK/f2LrJKclpzk0khJZEczTK/ah0YVIhA8fBzR4Y4A8OixhIqgAtHZNdGmwf5vDZFIMK6r/mgZ9xBE3RSd0eLuMspEQlsnMyZDJjtesboQfkNNnfWoTm8ZifqDUvVWq1bYXu8GgCprUhK7XsEYNy8QB0i8Dx9GtJgFqmloesPakOv8OhZoqA6cufVw2samIPLz8FF4VInRm5v45vrEsq4q4IwiIUwxBfPhuV9+haJiQeb4nE84U0veo4IoLGWGhn09fA6eNtbjaisab/hn+DBhjOrZZtNsTn7zi86HiiNke5opsJPxilOUZdBxECJccTAI3WLBzO/0fHkFGRqzFRZoicCs8LF+WuUBPjoPfIWF7rhY/DnoHQwvxdv/tOGhFFmFEdbBpVO1zRraTT/oNqnm629u0dmGwTe9E8W3LEdnrHWu+1q2cWDRyk1kh/bHcMuL+cg+GgYW2UutRhlGl+TxLZGWrknD1Q3J6T3DJp9pIqyW71o91Rstz/0wu1j9

pasted as is from catting it from gnome-terminal.

Revision history for this message
Simon L'nu (simon-lnu) said :
#10

Never mind... my key is so old that it was made pre-exploit, and doesn't have the newer syntax with the comment section in it.

Revision history for this message
Pablo Olmos de Aguilera Corradini (pablox) said :
#11

Look here:

https://answers.launchpad.net/launchpad/+question/26705

The message from Rudy helped me... and this is how I made it worked:

For some reason after creating the public key (in Xubuntu Jaunty) after the "==" said: user@hostname and it told me when I tried to uploaded to Launchapd "Invalid Public Key". It looks like the system don't accept characters such "@" for the comment, because I changed it and then it worked :).

Revision history for this message
Vamsi (info-cdnpic) said :
#12

go to your home directory and enable hidden hidden files.then go to .ssh directory..
then use gedit , to open the public key..
then paste it in launchpad..it will accept ;)

Revision history for this message
fjrodriguez (pako-rodriguez) said :
#13

I thing that the format the public key must be: ssh-rsa <your_public_key> <need_a_comment>. I tried to to import without a comment and i had this error. I added the comment and I could import the public key.

Revision history for this message
caosen (caosena5101) said :
#14

this is my ssh key:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKJEbMsjvKoIylxdpOqwNOwII+pmcmy3mHsGAO5nT3rLSO+pO2jA8pfNc8mYyxXSnjIJ+qVb795zxLz4Yv1SriZ5Ilas8hbmTzP3B3rgpUKhQ7Ruy54UQl1aGlB94uOWbApG0cu11FPMCmMV2nCVD/VTyptFgofNsDx3EtPNbHr+2f0Najzg5KQOtgKJa5snwR9fQc$

I cannot upload SSH key either. Please advise.