SSH检查成功,但仍无法克隆git repo

SSH检查成功,但仍无法克隆git repo,git,ssh,Git,Ssh,在我的Mac中,我在我的~/.ssh目录中生成了ssh密钥 我还将id\u rsa.pub的公钥复制到我的GitHub帐户设置SSH密钥中 但我不能从GitHub克隆,他说: $ sudo git clone git@github.com:WHMCS/templates-six.git whmcs_six_template Cloning into 'whmcs_six_template'... Permission denied (publickey). fatal: Could not re

在我的Mac中,我在我的
~/.ssh
目录中生成了ssh密钥

我还将
id\u rsa.pub
的公钥复制到我的GitHub帐户设置SSH密钥中

但我不能从GitHub克隆,他说:

$ sudo git clone git@github.com:WHMCS/templates-six.git whmcs_six_template
Cloning into 'whmcs_six_template'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
然后我搜索了google,找到了检查SSH连接的方法:

$ ssh -T git@github.com
Hi sof-3! You've successfully authenticated, but GitHub does not provide shell access. 

您看到此检查成功,为什么克隆git repo时出现错误?

您应该使用当前帐户进行git克隆:

$ git clone git@github.com:WHMCS/templates-six.git whmcs_six_template
由于此
id\u rsa.pub
位于当前用户
~/.ssh/id\u rsa.pub
下,如果使用
root
user进行克隆,它将使用root用户的
.ssh
目录搜索您的私钥