【发布时间】:2021-03-11 19:22:07
【问题描述】:
我刚刚为 Gitlab 配置了一个部署密钥,这样它就不会每次都要求输入用户名和密码——但是在拉取时,它仍然失败并出现以下错误:
git@gitlab.com: Permission denied (publickey, keyboard-interactive).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
到目前为止我所做的是:
- 生成了可以在
~/.ssh/下找到的SSH密钥 - 复制并粘贴
id_rsa.pub到 Gitlab 部署密钥部分 - 将密钥添加到带有
ssh-add ~/.ssh/id_rsa的SSH 注册表 - 在
~/.ssh下设置一个配置文件,内容如下:Host gitlab.co RSAAuthentication yes IdentityFile ~/.ssh/id_rsa - 将
git remote从使用 HTTPS 的@更改为使用 SSH 的。
我在 Google 和 StackOverflow 上都搜索了可能的解决方案,但没有找到任何类似的讨论。有什么想法我可能会遗漏吗?
【问题讨论】:
标签: git ssh deployment gitlab