LoginSignup
60
43

More than 5 years have passed since last update.

公開鍵の形式を変更する

Posted at

SSH でアクセスさせるために公開鍵を送ってもらったら見たことのない形式だった。

id_rsa.pub
---- BEGIN SSH2 PUBLIC KEY ----
Comment: 
文字列
---- END SSH2 PUBLIC KEY ----

調べてみたら、SECSH 形式らしい。
OpenSSH の形式に変換しなきゃいけないのかな、と ssh-keygen の man をあたると、-i オプションで公開鍵の形式を変換できそうだった。
-m オプションで読み込むファイルの形式を指定できるが、デフォルトが RFC 4716/SSH2 public or private key。
RFC 4716 を見てみたら、この形式のことみたい。

$ ssh-keygen -i -f id_rsa.pub >> ~/.ssh/authorized_keys

ログインできた。

60
43
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
60
43