Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
4
Help us understand the problem. What is going on with this article?
@m-suizu@github

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>
4
Help us understand the problem. What is going on with this article?
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

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
4
Help us understand the problem. What is going on with this article?