【发布时间】:2021-12-09 16:03:12
【问题描述】:
我在我的 GitLab 配置文件设置中设置了我的公共 SSH RSA 密钥。在我的远程服务器上,我已经添加了我的 SSH 私钥:
ssh-add ~/.ssh/id_rsa
事实上,当我在远程服务器上运行 SSH 连接验证时,它已通过身份验证:
user@some-remote-server:/var/www$ ssh -T git@gitlab.com
The authenticity of host 'gitlab.com (xxx.xx.xxx.xx)' can't be established.
ECDSA key fingerprint is SHA256:anmsdaskdnaslkdmaskd.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitlab.com,xxx.xx.xxx.xx' (ECDSA) to the list of known hosts.
Enter passphrase for key '/home/user/.ssh/id_rsa':
Welcome to GitLab, @alramdein!
user@some-remote-server:/var/www$
我是存储库的所有者。但是当我运行 Git clone 时,它说fatal: Could not read from remote repository.
user@some-remote-server:/var/www$ sudo git clone git@gitlab.com:repo/repo.git
Cloning into 'repo'...
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.
user@some-remote-server:/var/www$
【问题讨论】: