我正在使用Ubuntu笔记本通过ssh连接到一个虚拟机。
在这个虚拟机中,我正在尝试使用以下命令来克隆一个git代码库:
/home/httpd$ sudo git clone git@github.com:NexwayGroup/softgallery
[sudo] password for jverstrynge:
Cloning into 'softgallery'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
我看到了这个SO问题,解决方案建议通过修改git配置来解决:
/home/httpd$ git config http.postBuffer 524288000
error: could not lock config file .git/config: No such file or directory
但我遇到了上述错误。有人知道如何解决吗?
我已经按照 Github 的说明 生成 SSH 密钥 并检查了连接,看起来没问题:
ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
Enter passphrase for key '/home/jverstrynge/.ssh/id_rsa':
Hi JVerstry! You've successfully authenticated, but GitHub does not provide shell access.
jverstrynge@devjverstrynge:/home/httpd$
sudo ssh -T git@github.com
?你是通过sudo克隆的。 - iltempo