最終更新:2018-05-25 (金) 22:00:53 (639d)  

ssh-keygen
Top / ssh-keygen

ssh-keygen -t rsa

This will create two files in your (hidden) ~/.ssh directory called id_rsa and id_rsa.pub. id_rsa is your private key and id_rsa.pub is your public key.

パラメータ

  • -t
    • rsa
    • dsa
  • -N パスフレーズ
  • -C "コメント"
  • b 鍵長 (RSAのデフォルトは2048)

鍵長の確認

  • ssh-keygen -l -f /path/to/id_rsa.pub
  • -l 公開鍵のフィンガープリントを表示
  • -f ファイルを指定

メモ

Ubuntu/パッケージ

  • $ ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/tokkyo/.ssh/id_rsa):
    Created directory '/home/tokkyo/.ssh'.
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/tokkyo/.ssh/id_rsa.
    Your public key has been saved in /home/tokkyo/.ssh/id_rsa.pub.
    The key fingerprint is:
    SHA256:yn9H5elm/lniuveCjhmN/fnTWI1t/cF445cIXHIk+yA tokkyo@X240
    The key's randomart image is:
    +---[RSA 2048]----+
    |                 |
    |           . .   |
    |            +    |
    |         E + o.  |
    |        S o *oo+o|
    |     . .   *.o+=*|
    |      o   o.+o=+B|
    |       .  .+o+B**|
    |        ..oo+B=**|
    +----[SHA256]-----+