我正在使用带有密码的私钥,j
我已将其设置为测试,因为它让我发疯。
我正在尝试 bitbucket,我已将公钥添加到他们的网站。
我已将其ppk
添加到密钥列表时Pageant Key List
必须输入密码,j
因此我 100% 确信密码是正确的。
为了测试我正在使用ssh -Tv [email protected]
$ ssh -Tv [email protected]
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /c/Users/hUTBER/.ssh/config
debug1: /c/Users/hUTBER/.ssh/config line 3: Applying options for bitbucket.org
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucket.org [131.103.20.167] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/hUTBER/.ssh/bitbucket2.ppk type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/hUTBER/.ssh/bitbucket2.ppk-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in /c/Users/hUTBER/.ssh/known_hosts:14
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/hUTBER/.ssh/bitbucket2.ppk
Enter passphrase for key '/c/Users/hUTBER/.ssh/bitbucket2.ppk': //entered j
Enter passphrase for key '/c/Users/hUTBER/.ssh/bitbucket2.ppk': //entered j
我怎样才能在这里克隆事物?
答案1
.ppk 文件是 PuTTY 的专有密钥格式;ssh 无法理解这一点(并且很可能只是假设您输入了错误的密码)。
要解决此问题,请尝试以下操作:
- 从下载 PuTTYGen官方PuTTY下载页面如果你还没有
- 打开它,然后从
Conversions
菜单中选择Import key
- 浏览并选择您的 .ppk 文件——您会注意到,系统会提示您输入密码(在您的测试用例中,密码为“j”)。您的密钥现在应该已加载到 PuTTYGen 中。
- 从
Conversions
菜单中选择Export OpenSSH key
- 输入任何文件名(根据您的日志,您可以使用“bitbucket2”,不带扩展名 - 如果您需要扩展名,“.key”是私钥的常用扩展名)并单击
Save
- 修改您的 SSH 配置(
/c/Users/hUTBER/.ssh/config
根据您的日志)以引用导出的密钥而不是 .ppk 文件
现在,当您使用 ssh 时,它应该能够识别密钥格式。系统将提示您输入密码(与密钥本身一起导出),然后您就可以登录了。