Git克隆在公钥上失败.有什么我想念的吗?

AJP*_*AJP 1 linux git ssh public-key

由于Bundle安装阻塞来自theRubyRacer,JSON和其他宝石的libv8依赖关系,我试图安装并运行Ubuntu.复制.gitconfig和.ssh/rsa_id和.ssh/rsa_id.pub文件,但尝试使用私有仓库的git克隆,可以在win7上运行但在linux上失败(使用相同的公钥):

james@ubuntu:/documents/projects/$ sudo git clone git@github.com:the_project/back_end
[sudo] password for james: 
Cloning into back_end...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

vs win7's:

C:\test>git clone git@github.com:the_project/back_end
Cloning into back_end...
Enter passphrase for key '/c/Users/AJames/.shh/id_rsa':
remote: Counting objects: 10034, done.
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?谢谢!!

Amb*_*ber 5

使用sudo会导致它尝试使用rootSSH密钥,而不是您自己的密钥.

您可能真的应该授予自己对要克隆的目录的访问权限,或者克隆到您已经访问过的目录中.