The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

bitbucket, ssh key can't have name other than id_rsa

Gary Liang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 2, 2017

if my key is named id_rsa.pub and I put it into bitbucket ssh setting. It is working out of box. When I ssk-keygen name like id_rsa_else.pub, then insert to ssh key setting. It is saying

I try this in ~/.ssh/config

Host andatech_bitbucket_my_username
  HostName bitbucket.org
  User andatech_my_username
  IdentityFile ~/.ssh/andatech_my_username_bitbucket

 

I got this error:

repository access denied.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 More detail: https://stackoverflow.com/questions/44329025/bitbucket-ssh-key-cant-have-name-other-than-id-rsa

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 2, 2017

Are the remotes on your repos listed as "andatech_bitbucket_my_username" or as "bitbucket.org"? If the first part of the URL isn't "andatech_bitbucket_my_username", then SSH won't refer to that stanza in your config, and as a result it won't use the key you want.

You can fix this in one of two ways:

1. If you want to make all SSH connections to Bitbucket use that key and username, then change your .ssh/config to have "Host bitbucket.org" instead of what you've listed here.

2. If you want certain repos to use that key, but other connections to Bitbucket to use something else, then go to those repos and run this:

git remote set-url origin andatech_bitbucket_my_username:owner/repo.git

(changing "owner" and "repo" appropriately)

TAGS
AUG Leaders

Atlassian Community Events