加载密钥“privkey.ppk”格式无效

AAT*_*RAN 9 ssh ssh-keys ubuntu-18.04

我做了什么:
我正在尝试使用私钥连接到我的远程服务器

ssh -i privkey.ppk root@ip
Run Code Online (Sandbox Code Playgroud)

但它返回一个错误。
错误信息:

Load key "privkey.ppk": invalid format
root@ip: Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)

预期结果:
我应该能够使用 ssh 密钥登录到我的远程服务器。

关键文件内容:

PuTTY-User-Key-File-2: ssh-rsa
Encryption: aes256-cbc
Comment: rsa-key-20181019
Public-Lines: 6
some lines
Private-Lines: 14
some lines
Private-MAC: some letters
Run Code Online (Sandbox Code Playgroud)

操作系统: Ubuntu 18.04

附:

  1. 我在 putty、termius 中使用相同的密钥登录到我的远程服务器并且它工作正常
  2. Ansible ping cmd 也返回相同的结果)

Rom*_*nov 17

该密钥由 PuTTYgen 软件生成。要在 linux 中使用它,您应该启动 PuTTYgen,加载密钥(文件->加载私钥),然后将其导出为 OpenSSH 密钥(转换->导出 OpenSSH 密钥)


AAT*_*RAN 7

我的 PPK 是腻子 PPK 格式,我必须转换成 OpenSSH 格式。
我使用此答案将 .ppk 转换为 OpenSSH ,现在我可以连接了。

puttygen id_dsa.ppk -O public-openssh -o id_dsa.pub
Run Code Online (Sandbox Code Playgroud)