I've a private bitbucket account and one of my company.
SourceTree has automatically configured my ssh config file, where each entry (for each account) starts with "Host <username>-Bitbucket".
Since macOS Sierra, it isn't possible anymore to communicate with my bitbucket repos.
If I change the entry to "Host bitbucket.org" it works for the first account, depends on which entry is listed first. For both entries, following settings are configured:
Both passphrases are stored correctly in the keychain. I'm using SourceTree by the way, but it's the same in the terminal.
I would be so grateful to you, if you can help me - it's so annoying, the only workaround which i know, call "ssh-add -A" after booting.
Hi Andreas, if this issue is also happening to you in the terminal, then it's not caused by Sourcetree :)
To add both your Bitbucket accounts credentials separately, you can follow the instructions in this post Different SSH keys for different accounts on same Git hosting.
You can also find more info in our official documentation at Set up additional SSH keys.
You can also test the BitBucket server to see which account you are logging in with, to do that run:
ssh -v firstname.lastname@example.org
And lastly if you need to cheack that the Keychain has the right kays, you can see all of them by running:
Let us know if this helps!
Hey Ana, thank you very much for your help :)
The ssh -v email@example.com command really helps a lot to figure out such problems. (I've also tried <user>@bitbucket.org)
I found out, that the ssh-agent always wants to use my default key (id_rsa) because of this output:
debug1: /Users/andreas/.ssh/config line 34: Applying options for *
This matches the line "Host *" of my ssh config.
I think anyway, SourceTree has some effect to this, here is my generated entry in the ssh config:
# --- SourceTree Generated ---
So when does ssh choose exactly this key, located at the "IdentityFile" path.
The command mentioned above uses the key referenced "Host *", not the key of "Host <user>-Bitbucket".
In your link "Different SSH keys ..." I've seen the ssh-add command to add the new key - this works, but I don't want to do this after every restart. :/
So the problem is in the line "Host <user>-Bitbucket" I think, because the output should then be like "Applying options for <user>-Bitbucket".
Btw, my colleague has the same problem since a few days.
Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs