git 克隆时 SSH 密钥失败



尝试使用命令从 Bitbucket 克隆我的项目git clone .

在此之前,我已经在Bitbucket中创建了SSH密钥对,我已经将公共密钥对放在了~/.ssh/authorized_keys中,该密钥对正在尝试克隆项目。我还执行了命令:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

执行git clone后出现错误:

Initialized empty Git repository in /home/g/projects/mypro/.git/
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

如何从Bitbucket克隆项目?

您需要将

本地计算机中的公钥(默认情况下~/.ssh/id_rsa.pub(添加到BitBucket帐户中的"SSH密钥"部分。

有关详细信息,请参阅 BitBucket 文档。

最新更新