Zackio
11/20/2017 - 9:07 AM

SSH Bitbucket

I had problems with ssh access. So in sourcetree use ouath and http to connect

Setup SSH

Check if you have keys already, you want id_rsa.pub:

ls -a ~/.ssh

If it's there, copy it's contents and go to bitbucket > Manage accounts > ssh

If not create a pair then go put it there.

ssh-keygen -t rsa

You'll be promted for a name - use a unique reference.

A new pair also needs adding to your ssh client. Secound adds to keychain so we have it for soucetree

ssh-add ~/.ssh/id_rsa
ssh-add -K ~/.ssh/id_rsa

This only adds temporarity until reboot for permanance

https://macnative.com/permanently-add-my-ssh-key-to-the-keychain-in-osx-mojave/

Add to .ssh/config

Host * UseKeychain yes AddKeysToAgent yes IdentityFile ~/.ssh/id_rsa

! If asks for password still

Go to your git folder and look at this file.

vim .git/config

if under remote origin url is a htts then you need to get the ssh address. go to the bitbucket project and grab the clone url for ssh Then put that as the url instead

Copy the rsa file with this (mac)

pbcopy < ~/.ssh/id_rsa.pub

That should be it. For more information, go here:

https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git