我一直在设置一个服务器实例(Amazon EC2、Ubuntu 12.x),并且在尝试从 git 克隆我自己的私有仓库时遇到了困难。
我一直在看https://help.github.com/articles/generating-ssh-keys和https://help.github.com/articles/error-permission-denied-publickey一段时间,但仍然没有好的。
我在远程机器上生成了一个新的 ssh 密钥对
ssh-keygen -t rsa -C "myemailaddress@myemail.com"
并很好地设置了我的 git 配置,并且我已将公钥添加到我的 github 帐户中。电子邮件地址与我在本地计算机的 ssh 密钥上使用的电子邮件地址相同(我不知道这是否重要)。
在启动一个 ssh-agent 然后做之后ssh-add -l
,我得到一个与我的 github 公钥中所说的相匹配的指纹结果。ssh -T git@github.com
还告诉我我已成功通过身份验证。
但是,每当我尝试
git clone https://github.com/dmonopoly/myprivateproject.git
或者
git clone git@github.com:dmonopoly/myprivateproject.git
在远程机器上(我已经 sshed 进入),我得到这个错误:
fatal: could not create work tree dir 'myprivateproject'.: Permission denied
想法?我已经处理过permission denied (public key)
以前的问题,但这似乎有所不同。帮助表示赞赏。