一. 终端出现的提示:
-
第一种提示:
tucici@tucicideMac-mini GVoice % git push git@47.114.45.10's password: Permission denied, please try again. git@47.114.45.10's password: Permission denied, please try again. git@47.114.45.10's password:
-
第二种提示:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
二. 原因:
-
前提 :
- rsa正常生成情况下
ssh-keygen -t rsa -C xxx
- rsa_pub正常添加到仓库sshKey
- rsa正常生成情况下
这是因为,创建了rsa,没有添加到本地ssh,所以本地ssh不识别你创建的这个rsa,自然推不上去了。
三. 解决:
-
让ssh识别新创建的rsa私钥
ssh-add /Users/tucici/Documents/ras
-
添加SSH到钥匙串
ssh-add -K /Users/tucici/Documents/ras