1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues


Issue #7905 invalid

Apparently valid SSH key is rejected by Bitbucket's SSH key page (BB-9079)

created an issue

I recently ran into difficulty adapting my Git workflow to Bitbucket. I've been using a particular SSH key for my work, but when I tried to import it into Bitbucket, I got an "Invalid SSH key" message. #4929 approaches this by asking for a better error description. However, I'm almost positive this one was a mistake on Bitbucket's part, not a problem with my SSH key, and should be addressed at the source. I say this because I was able to use this key in GitHub, and import it from GitHub to Bitbucket, without problems!

Steps to reproduce: Log into Bitbucket. Up in the top right, click on the popdown menu with my avatar icon, and select "Manage account". In the right-hand nav, select "SSH keys". Click on the button "Add key". In the "Add SSH key" dialog: under Label, enter: osmith@home. Under Key, copy the key from my id_dsa.pub and paste. Then click on the button "Add key".

Expected behavior: Bitbucket accepts the key, dismisses the dialog, and shows the newly entered key in the SSH keys list. Git clones on my account work with this new key.

Actual behavior: Bitbucket takes a few seconds, and then displays an error message below the Key field: "Invalid SSH key." No Git work can be done with the key.

Workaround: Import the key into GitHub (which succeeds), then return to Bitbucket, come back to the "SSH keys" page, and click on the button "Import keys from GitHub." A message is displayed, "1 key imported," and the new key is listed in my SSH keys. Git clones now work.

Data: See user account ods94065 for the specific key that Bitbucket didn't like. It is a DSA key, which I believe I created via openssh on a Mac by running 'ssh-keygen -t dsa'. The key name is "ods94065@hawk.arvixe.com".

Comments (8)

  1. Marcus Bertrand staff

    This sounds like it belongs in support. Please open a support request at support.atlassian.com so we can take a look at your key and see what the actual error may be. Please attach your .pub key file to the issue.

  2. ods94065 reporter

    Not sure why this belongs in Support, as 1) I do not have a service agreement, 2) I found a workaround, and 3) per Dan's comment this does not seem to be an isolated issue. Can you clarify?

  3. Marcus Bertrand staff

    Support is available to anyone using the site. Registering a support account at id.atlassian.com / support.atlassian.com is completely free.

    Also, we haven't had any other issues around this, so we'd like to treat this privately unless we see that this is an issue affecting many users.

  4. Anonymous

    I have the same problem. The key I use in my private Bitbucket repository that I set up a couple of years ago fails to import to my company's (i.e. my employer) repository.

  5. Log in to comment