-1

I don't know how exactly to ask this. When I try access remote repo (in bitbucket) using SSH, I couldn't run some commands, e.g. git push or git pull.

When I do that, I prompted to enter password to access to the private locked key (which I don't know what it means). I don't know which password should I enter, I've try entering password for my account, and passphrase I enter for ssh-keygen command, but none of these correct.

Anyone knows what the problem, please help.

These some output when I cancel and exit the prompt:

$ git push -u origin main
sign_and_send_pubkey: signing failed for RSA "/home/user/.ssh/id_rsa" from agent: agent refused operation
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.

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

1 Answers1

1

Make sure you have added correct public key to your bibucket Account settings

When attempting to clone, push, or pull over SSH with Git, you may receive one of these messages if Bitbucket couldn't authenticate with the keys that your SSH agent offered.

Here are the most common reasons why you may see these messages:

You used sudo when attempting the connection

You shouldn't use sudo when cloning, pushing, or pulling because the ssh-agent runs on the user level, not the root level.

Your public key isn't loaded into Bitbucket

To check if your public key is loaded into Bitbucket, do the following:

From Bitbucket, choose Personal settings from your avatar in the lower left. The Account settings page displays.

Click SSH keys. The SSH keys page shows a list of any existing keys.

If you don't have any keys listed, you can follow our Set up an SSH key documentation to set one up.

Your key isn't loaded into your SSH agent

If your SSH agent doesn't know to offer Bitbucket a key, the connection fails. You may run into this issue if you've recently restarted your system.

To find out what keys your SSH agent is currently offering and to add them to the agent:

From the terminal

Check to see if your SSH key is loaded:

$ ssh-add -l

If you don't see your key listed, add it by entering ssh-add followed by the path to the private key file:

$ ssh-add ~/.ssh/<private_key_file>

Bhushan Uniyal
  • 5,575
  • 2
  • 22
  • 45