无法进行 git push 操作:git@github.com: Permission denied (publickey)。

4

在特定项目中,我无法执行git push命令,然而,在其他项目中一切都很顺利,我不知道还能做些什么。我有一把密钥,这把密钥已在 GitHub 上注册,并且代理似乎在工作。

当我尝试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.

我已经阅读了文档,但它并没有对我有太大帮助。


请参阅以下网址以了解有关“sign_and_send_pubkey:signing failed from agent:agent refused operation”的问题的更多信息:https://dev59.com/rlcP5IYBdhLWcg3wiqZr。 - phd
3个回答

1

尝试再次通过ssh连接远程Git存储库GitHub,例如:

ssh -T git@sofija_personal-github.com

注意:配置SSH配置文件!

在 /.ssh 目录下创建或编辑一个配置文件:

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

注意 vimbash 的常用命令:

  1. 按字母键 "i" 进入编辑模式;

  2. 按回车键 "esc" + 输入字母 ":wq":保存并退出;

进行编辑和添加:

Host sofija_personal-github.com

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

然后,只需使用git pull --rebase && git push

此外,GitLabBitbucket也可以这样做。


0

错误:

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.

我已经解决了

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

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接