4

I'm not able to perform the git push command in a specific project, however, in other projects everything goes well, I don't know what can be done anymore. I have a key, this key is registered on GitHub and apparently the Agent is working.

This is the result when I try to git push:

username@lenovo-ideapad-s145:~/development/projects/Learning-Laravel$ git push
sign_and_send_pubkey: signing failed for ED25519 "/home/username/.ssh/id_ed25519" from agent: agent refused operation
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

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

I've read the documentation, but it didn't help me much.

phd
  • 82,685
  • 13
  • 120
  • 165
raulpacheco2k
  • 41
  • 1
  • 1
  • 4
  • https://stackoverflow.com/q/44250002/7976758 Found in https://stackoverflow.com/search?q=sign_and_send_pubkey%3A+signing+failed+from+agent%3A+agent+refused+operation – phd Jul 14 '21 at 13:02

3 Answers3

0

You wouldn't be have configured ssh in your machine. Check if this answer helps

GitHub Error Message - Permission denied (publickey)

Lux
  • 73
  • 9
0

Error:

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

With me it was resolved

git pull https://github.com/<your-user>/<your repository.git>
0

Just try to connect the remote Git repository GitHub via ssh again, e.g:

ssh -T git@sofija_personal-github.com

Notice: Configure SSH config file!

Create or edit a config configuration file in the /.ssh directory:

cd /Users/user-name/.ssh && vim config

Pay attention to the common commands of vim or bash:

  1. Press the letter key "i" to edit mode;

  2. Press the return key "esc" + input the letter ":wq": save and exit;

Edit and adding :

Host sofija_personal-github.com

   Hostname github.com
   
   User git
   
   AddKeysToAgent yes
   
   UseKeychain yes
   
   IdentityFile /Users/marryme/.ssh/sofija_personal_github_id_rsa

Then, just use git pull --rebase && git push.

Also, GitLab or Bitbucket do the same.

Vittore Marcas
  • 1,007
  • 8
  • 11