git报错:git Permission denied, please try again.

1 问题描述:

git clone/pull代码时提示输入密码,密码输入正确但是报错:git Permission denied, please try again.

2 解决方案:

  • step1 检查SSH Key是否存在
#cd ~/.ssh
#ls

在这里插入图片描述

  • step2 获取SSH Key

如果存在id_rsa.pub 或 id_dsa.pub 文件,跳过此步。

如果不存在,则生成:

    • 先查看git邮箱地址
#git config --list
    • 再生成SSH Key
#ssh-keygen -t rsa -C "[email protected]"
  • step3 将公钥复制到git页面profile setting > SSHKeys中
#cat ~/.ssh/id_rsa.pub

复制到SSH Keys页面中保存

  • step4 重新执行git clone/pull

猜你喜欢

转载自blog.csdn.net/qq_41943900/article/details/133297533