WAVE Log
ssh-keygen

SSH の公開鍵と秘密鍵を作成

# ssh-keygen -t rsa -b 4096 -C "" Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user/.ssh/id_rsa. Your public key has been saved in /home/user/.ssh/id_rsa.pub. The key fingerprint is: SHA256:zQCfC3+ezXNbyjB+0r+XsfV8uMuhq1qqAiM4FDDe0L0 The key's randomart image is: +---[RSA 4096]----+ |+.. . . | |.oo. . o . | | ... o + | | . E o = | |o S + | |+ o o + ..| | o o + *.ooB| | . o ..O+B=| | ...o...++B==| +----[SHA256]-----+

オプション
-t 方式:作成する鍵の暗号化形式を指定する。
-b ビット数:作成する鍵のビット数を指定する。
-C コメント:コメントを指定する。「-C ""」でコメントを削除。(デフォルトは「ユーザー名@ホスト名」)

オプションなしのデフォルト値では。↓

# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user/.ssh/id_rsa. Your public key has been saved in /home/user/.ssh/id_rsa.pub. The key fingerprint is: SHA256:ItXlRCbefj/pVMC0dC58JEZBvaBQn1+nrHoYs3yzwZg user@localhost.localdomain The key's randomart image is: +---[RSA 3072]----+ | ..*. oOoo| | o O .B.*.| | . o + .oB *| | . . . ..*o| | . . S . . o..| | . . o= o o | | .E=+ = | | +.++ . | | .o.o. | +----[SHA256]-----+

デフォルト値やオプションで選択できる値などは、ssh のバージョンにより異なることがある。

# ssh -V OpenSSH_8.1p1, OpenSSL 1.1.1d FIPS 10 Sep 2019

# man ssh-keygen