- Generate key with
ssh-keygen
, as path enter the same as suggested with a different filename of 'git' - run
sudo nano ~/.ssh/config
and add contents like
# add bitbucket deployment key to identity file
Host bitbucket.org
User git
IdentityFile ~/.ssh/git
- Correct the permissions of the file if it is the first time being used to
chmod 600 ~/.ssh/config
andsudo chown currentUserName:currentUserGroup ~/.ssh/config
- dump public key to console with
cat ~/.ssh/git.pub
- copy this key into the bitbucket/github add keys input
Done!