Dinesh Ahuja
Dinesh Ahuja

Reputation: 1015

Take pull from bitbucket without password prompt

I want to take pull from my bitbucket repo without asking the password every time. I am using Ubuntu 16.04 LTS

Steps,

$ssh-keygen

It generated two key files, id_rsa and id_rsa.pub

Then, in the Bitbucket repo settings, I have added the ssh key of the server.

$cat ~/.ssh/id_rsa.pub

But it is not working. It is still asking for password.

Upvotes: 3

Views: 6122

Answers (3)

user43968
user43968

Reputation: 2129

Bitbucket have a pretty good tutorial explaining how to set up an ssh key.

If you have carefully follwed this (especially the ssh-agent part), maybe you need to update your config.

In your cloned repo you have a .git folder with a config file Inside. Open it and check that you have an ssh url.

You should see somehing like :

[remote "origin"]
    url = ssh://[email protected]:<username>/<repoName>.git

Here another bitbucket tutorial that explained it.

Upvotes: 1

Dinesh Ahuja
Dinesh Ahuja

Reputation: 1015

I had to add the key file in ~/.ssh/config

Host bitbucket.org
 HostName bitbucket.org
 IdentityFile ~/.ssh/id_rsa

I also added key id_rsa.pub in the bitbucket repo. It is working fine now.

Upvotes: 1

Sascha Effert
Sascha Effert

Reputation: 2432

The problem could also be that the ssh-agent is not using the key yet. I had this once and spend some time not mentioning this. Please try to run

ssh-add ~/.ssh/id_rsa

and than try again to checkout...

Upvotes: 3

Related Questions