user7151969
user7151969

Reputation:

Permission denied (publickey) when clone git repo from bitbucket

I just created the git repo on bitbucket. Then I create the ssh key by follow:

   1. ssh-keygen -t rsa -C '[email protected]'
   2. ssh-keygen (press enter more)
   3. cat ~/.ssh/id_rsa.pub --> it return for me a SSH key
   4. Coppy that and added on bitbucket, then I save the new SSH key

After that I chose SSH link git like [email protected]:DienVo/abc.git, but In the terminal it show that

sign_and_send_pubkey: signing failed: agent refused operation
Permission denied (publickey).
fatal: Could not read from remote repository.

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

I don't know what is I wrong here, please help me to resolve it.

Upvotes: 4

Views: 8108

Answers (2)

Harshil Patanvadiya
Harshil Patanvadiya

Reputation: 309

I faced the same issue in Ubuntu

Need to set the permission of your ssh folder, private and, public keys.

Run the below command in terminal

chmod 700 ~/.ssh
chmod 600 ~/.ssh/*

After restarting the terminal and try to connect the ssh connection.

Upvotes: 2

VonC
VonC

Reputation: 1329652

Your ssh agent might not be working:

eval `ssh-agent -s` 
ssh-add

But you only need an agent if you generated an ssh key protected with a passphrase.
If not, your ssh key would work out of the box.

On Linux, check gnome-keyring which can interfere.

If the issue persists, debug with ssh -Tv [email protected]

Upvotes: 10

Related Questions