相关疑难解决方法(0)

Git SSH公钥被拒绝

我正在使用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.
Run Code Online (Sandbox Code Playgroud)

我已将公钥添加到我的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.
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

更新:

在$ HOME克隆工作正常.问题是必须在/ var/www/git上使用sudo.我有什么办法改变权限以避免使用sudo?

git ssh bitbucket

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

bitbucket ×1

git ×1

ssh ×1