用新电脑克隆 gitlab 上的仓库时,报了 Permission denied 的错误:
git clone ssh://git@xxx/CHARLEY-FE/ICB_MONITOR.git
Cloning into 'ICB_MONITOR'...
git@xxx's password:
Permission denied, please try again.
git@xxx's password:
Permission denied, please try again.
git@xxx's password:
git@xxx: 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.
我已经在本地生成了公私钥文件,但在克隆仓库时报错。在网上找到了原因,这是因为我在生成公钥时使用了自定义的名称而不是 id_rsa 和 id_rsa.pub,于是我将生成的密钥文件进行改名,再克隆,就可以了。
完。