我的bitbucket账户上有一个私人存储库。今天,我想添加一台新的计算机来访问一个私有存储库。
所以我做了以下几件事:
ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/d/.ssh/id_rsa):
Created directory '/d/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /d/.ssh/id_rsa.
Your public key has been saved in /d/.ssh/id_rsa.pub.之后,我从id_rsa.pub复制了密钥,并将其添加到bitbucket存储库中的ssh-键列表中。
然而..。当我现在想要克隆我的存储库时,我会得到以下错误:
Permssion denied (publickey)
fatal: Could not read from remote repository问题出在哪里?
发布于 2014-03-28 15:19:19
在从id_rsa克隆时,一定要使用生成的私钥(在您的情况下是BitBucket):
git -i /path/to/your/private/key clone git@bitbucket.org/owner/project.git编辑
一个更持久和方便的解决方案是在上面的命令中省略-i /path/to/your/private/key部件,而是在SSH配置文件中包含以下内容:
Host bitbucket.org
IdentityFile /path/to/your/private/keyhttps://stackoverflow.com/questions/22707527
复制相似问题