Help us understand the problem. What is going on with this article?

SSH の id_rsa.pub を RFC4716 形式で出力する

More than 3 years have passed since last update.

Microsoft の Azule で仮想PCを作成しようとしたら SSH の公開鍵を要求されて、id_rsa.pub の内容をコピペしたら ''---- BEGIN SSH2 PUBLIC KEY ----'' で始まる形式にしろと言われたので変換。

$ ssh-keygen -e -f ~/.ssh/id_rsa.pub
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "2048-bit RSA, converted by suisui from Ope"
<BASE64 ENCODED KEY ...>
---- END SSH2 PUBLIC KEY ----

逆向きの変換は、先に検索でヒットしたのだけど、自分の欲しい出力が RFC4716 形式だったので。何のことはない ssh-keygen --help を読めば書いてあった

逆 (IN: RFC4716 -> OUT: SSH2)

タイトルとは逆の変換

$ ssh-keygen -i -f rfc4716.pub
ssh-rsa <BASE64 ENCODED KEY ...> <COMMENT>
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away