I'm using bitbucket.org
to my manage my repositories both at work and personally.
On my new MacBook Pro, I generated a new SSH key and then added that to my work account on bitbucket.org and have had no issues with committing my work. This key is saved on my machine at ~/.ssh/id_rsa
.
Now, I am trying to add my personal account on the machine, and having all types of issues with committing my work.
I generated a ssh
key using the following command:
ssh-keygen
I saved this key at ~/.ssh/id_personal_rsa
and then copy the key into my personal bitbucket.org account.
I then created a config
file at ~/.ssh/config
that has the follow entries:
Host *
IdentityFile ~/.ssh/id_rsa
Host bitbucket.org-personal
HostName bitbucket.org
User git
IdentityFile ~/.ssh/id_personal_rsa
IdentitiesOnly yes
(The personal
string is just replaced with my actual account name.)
Now, for the issue, when I try and commit work, I am getting this error:
Git: git@bitbucket.org: Permission denied (publickey).
This is the config
file for my .ssh connection in my project:
[remote "origin"]
url = git@bitbucket.org-personal:personal/my-personal-project.git
fetch = +refs/heads/*:refs/remotes/origin/*
Any thoughts on what I may have configured incorrectly?
UPDATE: I've updated my config for my personal account to reflect some of the answers from this post and from this link: Bitbucket ssh public key is being denied but their ssh test connects with no issue.
When I run this command: ssh -T git@bitbucket.org-personal
, I get this response:
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
However, I am still getting Permission denied
when trying to commit my new changes.