内容仅供参考,有问题请留言相互讨论。
我记得以前新建的虚拟机上使用git进行clone也没有问题,现在直接clone就会报一下错误:
sky@ubuntu:~$ git clone git@github.com:RUB-SysSec/Marx.git
Cloning into 'Marx'...
The authenticity of host 'github.com (192.30.253.112)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
可能是github修改了协议之后必须上传自己的公钥才可以使用git的clone功能。
测试:
ssh -vT git@github.com
返回结果
Permission denied (publickey).
解决办法:
将自己的公钥上传到自己的github账户。
1.sky@ubuntu:~$ ssh-keygen -t rsa
回车三次生公钥
2.将~/.ssh/id_rsa.pub中的数据上传到github:Settings->SSH and GPG keys->New SSH Key