我正在使用Bitbucket,并按照此处的要求为Linux(Ubuntu 13.04)设置了git ssh。
https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678
但是,当我尝试从Bitbucket帐户克隆任何项目时,出现了公钥拒绝错误。
omk@home-pc:/var/www/git$ sudo git clone git@bitbucket.org:MyAccount/MyProject.git
Cloning into 'MyProject'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我已将公钥添加到我的Bitbucket账户中。
当我尝试输入“ssh -T git@bitbucket.org”时,终端才提示我输入我的密码,并且我会收到我的账户名称作为响应。
omk@home-pc:/var/www/git$ ssh -T git@bitbucket.org
logged in as MyUsername.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
我错过了什么吗?
更新:
在$HOME克隆正常工作。问题在于必须在/var/www/git使用sudo。有什么办法可以更改权限以避免使用sudo吗?