我正在尝试使用我用 putty (Win) 创建的密钥从 Mac 登录到服务器。输出(其中一些如下所示)看起来像是在尝试,但我没有密码,所以当对话框出现时我只是按回车键,所以我不知道如何让它接受空白密码。我知道它可以在我的 Win 机器上运行,无需密码或密码。
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/michael/.ssh/b.ppk
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug2: bad passphrase given, try again...
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug2: bad passphrase given, try again...
debug2: no passphrase given, try next key
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
答案1
您需要将您的 Putty 私钥 (.ppk) 转换为类似于标准 SSH 密钥的东西 -puttygen
可以为您完成此操作(参见此链接或者向 Google 询问有关 puttygen 的信息...)
答案2
这篇文章来自 Stack Overflow给出了有关使用 OSX 终端将 PEM 密钥转换为 PPK 的答案:
sudo port install putty
puttygen privatekey.ppk -O private-openssh -o privatekey.pem