SSH key with BitBucket doesn't seem to work
Clash Royale CLAN TAG#URR8PPP
SSH key with BitBucket doesn't seem to work
I generated an SSH key on my server by doing these commands:
ssh-keygen -t rsa -b 4096 -C "address@email.com"
eval $(ssh-agent -s)
ssh-add /root/.ssh/id_rsa
I saved it to my BitBucket account.
Then, I dit ssh -T git@bitbucket.org
and I received the following answer :
ssh -T git@bitbucket.org
You can use git or hg to connect to Bitbucket. Shell access is disabled.
But when I'm doing a simple git pull origin master
on one of my repositories, it asks me again my password.
git pull origin master
Do you have an idea ?
1 Answer
1
Your git client has no way of knowing that you've created a new SSH key, or that you've added the public key to Bitbucket, unless you change the remote URLs for the repositories that are hosted there.
To see what the repository remote's URL is, cd to the local repo and run git remote get-url origin
.
git remote get-url origin
To change the origin remote's URL to an SSH one, run git remote set-url username@bitbucket.org:owner/repo.git
(replacing username
, owner
, and repo.git
with appropriate values).
git remote set-url username@bitbucket.org:owner/repo.git
username
owner
repo.git
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.