OpenSSH key pem和SSH2 key格式互转

“RFC4716” (RFC 4716/SSH2 public or private key)

“PKCS8” (PEM PKCS8 public key)

 

ubuntu:

ssh-keygen -e -f ~/.ssh/id_rsa.pub > ~/.ssh/id_rsa_pub.pem

ssh-keygen  -f ~/.ssh/id_rsa_pub.pem -i -m RFC4716 > ~/.ssh/id_rsa.pub

 

windows:

1)Use the puttyGen

2) Run puttygen and click generate

3) Run your mouse round the blank part for a while.

4) Enter a keyphrase (and repeat)

5) Click save public key and save it <path>\publickey

6) Click save private key and save it <path>\privatekey (extension gets added automatically, this is no good for spoon, but good for putty)

7) Click Conversions->Export OpenSSH key and save as <path>\sshkey.pem

8) In the main window is you key for pasting into OpenSSH authorized_keys file. Copy this in its entirety and past it into your ubuntu machine in /home/<user>/.ssh/authorized_keys file.

9) Ok, you can close putty key generator.

10) Utilize the .pem in the tool.


转自太极客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值