Did you follow the official documentation here: https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html ??
Bitbucked instructions:
The steps for enabling ssh in bitbucket are the following:
In your workstation:
$ ssh-keygen
(you can omit the password here by pressing enter when asked if you wish to simply use the key-pair without entering a decryption password each time you login)
After this, verify the keys are generated:
$ ls -l ~/.ssh
id_rsa
id_rsa.pub
Now you need to add the keys to your bitbucket settings:
- Go to the Account settings
- Click ssh keys
- Click Add key
- Write a "Label" with a descriptive sentence ("User Tismon at Home Workstation", for ex.).
- Copy the contents of
~/.ssh/id_rsa.pub
into the "Key" field (use cat ~/.ssh/id_rsa.pub
or open with a text editor, but make sure to copy everything from the file).
- Click save
- Verify everything is working as expected with
ssh -T git@bitbucked.org
Encrypted ssh keys:
There is no need to do ssh-add
unless you set up a password for the keys. If you did, you have to make sure the ssh-agent
is running and make sure you add the private key:
$ eval `ssh-agent`
$ ssh-add ~/.ssh/id_rsa
If you need an encrypted ssh-key, you have to ssh-add the key everytime you reboot, as ssh-add lasts as long as your session. If you don't want to enter the key or password everytime, the easiest way is not to encrypt it.