1 问题描述:

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

2 解决方案:

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

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

  • step2 获取SSH Key

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

如果不存在,则生成:

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

复制到SSH Keys页面中保存

  • step4 重新执行git clone/pull
09-27 11:10