【发布时间】:2017-08-07 23:29:36
【问题描述】:
我正在尝试使用 SSH 克隆 git 存储库。因此,我在本地机器上创建了一个 ssh 密钥对,并在我的 git repo(即 Bitbucket 服务器)上添加了公钥。
然后,正如我看到的here,我尝试像这样克隆:
git clone ssh://my_username@my-repository.com:7999/my_project.git
git clone ssh://git@my-repository.com:7999/my_project.git
但是这些选项不起作用:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我唯一的进步就是尝试这个:
git clone my_username@my-repository.com:7999/my_project.git
这要求我输入密码 3 次,然后失败。我怀疑这虽然不使用SSH, 因为我认为 SSH 不应该要求输入密码。
Password:
Password:
Password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
fatal: Could not read from remote repository.
那么如何使用 SSH 克隆 git repo?
编辑
我在 Windows 上并且正在使用 Git Bash。
ssh-add -l
返回
The agent has no identities.
【问题讨论】:
-
Bitbucket 私有服务器还是云托管服务器?
-
什么操作系统——Windows? Linux?操作系统?
-
@patricksteele Windows。我更新了问题。
-
@LasseV.Karlsen Bitbucket PRIVATE 服务器