Skip to content

Instantly share code, notes, and snippets.

@Zackio
Last active April 22, 2020 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zackio/9befe519cbe45b51d4a7910006f8850f to your computer and use it in GitHub Desktop.
Save Zackio/9befe519cbe45b51d4a7910006f8850f to your computer and use it in GitHub Desktop.
> 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment