Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Showing Invalid SSH Key

When I'm adding an SSH public key to Bitbucket Cloud, it was show an error

Invalid SSH Key

please help what to do?

1 answer

1 accepted

6 votes
Answer accepted

Hi @Ashima Khanna ,

Welcome to the community!

This error means that the data copied into the form was not able to be parsed to extract something that "looks like an SSH key". In many cases, the cause of this error is that the data pasted into the key field was copied incorrectly. Sometimes, this is due to line breaks being copied. Many tools will wrap the display of an SSH key. Simply highlighting and copying the key like this may copy line breaks depending on which text viewer you are using.

Windows

  1. From your avatar in the bottom left, click Bitbucket settings.
    Bitbucket displays the Account settings page.
  2. Click SSH keys.
    The SSH Keys page displays. It shows a list of any existing keys. Then, below that, a dialog for labeling and entering a new key.
  3. Switch to your local desktop and start the PuTTYgen program.
  4. Press Load.
  5. Navigate to and open your default private key.
  6. Enter your passphrase when prompted and press OK.
    The system displays your public key.putty_key
  7. Select and copy the contents of the Public key for pasting into OpenSSH authorized_keys file field.
  8. Back in your browser, enter a Label for your new key, for example, Default public key.
  9. Paste the copied public key into the SSH Key field:add_ssh_key
  10. Press Add key.
    The system adds the key and it appears in the SSH Keys listing.
  11. Close PuTTYgen.

OSX/Linux

  1. From Bitbucket Cloud, choose avatar > Bitbucket settings from the application menu. 
    The system displays the Account settings page.
  2. Click SSH keys.
    The SSH Keys page displays. If you have any existing keys, those appear on this page.

Back in your terminal window, copy the contents of your public key file.
For example, in Linux you can cat the contents.

cat ~/.ssh/id_rsa.pub

In Mac OS X, the following command copies the output to the clipboard:

pbcopy < ~/.ssh/id_rsa.pub

Back in your browser, enter a Label for your new key, for example, Default public key.

  1. Paste the copied public key into the SSH Key field:
  2. Press Add key.
    The system adds the key to your account. Bitbucket sends you an email to confirm addition of the key. 

Thanks for quick reply!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,888 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you