客户给的服务器登陆方式为一个 ppk 文件,经查阅资料,ppk 文件为 putty 软件的密钥,无法直接用于 ssh 命令登录,需要转化为 OpenSSH 格式的密钥
ssh
ppk 文件是 Putty 的私钥,PuTTY Private Key 的缩写
ppk 文件中同时包含了公钥和私钥,可用记事本打开查看
id_rsa 和 id_rsa.pub 都是 OpenSSH 格式的密钥
id_rsa 是 OpenSSH 格式的 SSH 私钥
id_rsa.pub 是 OpenSSH 格式的 SSH 公钥
用记事本打开的 ppk 文件内容如下
至此,OpenSSH 格式的密钥就已经转换完毕,可以用来做免密认证。
Last updated 1 year ago
yum install putty -y
puttygen ./ssh.ppk -O public-openssh -o ./id_rsa.pub
puttygen ./ssh.ppk -O private-openssh -o ./id_rsa
cat ./id_rsa