10. SSH鍵ペアを作成する
1) すでに鍵ペアがあった場合、上書きしないように .ssh ディレクトリをバックアップする
$ [ -d ${HOME}/.ssh ] && cp -pr ${HOME}/.ssh ${HOME}/DOT.ssh.$(date +%Y%m%d)
2) ssh-keygenコマンドで鍵ペアを作成する
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oresama/.ssh/id_rsa):
/home/oresama/.ssh/id_rsa already exists.
Overwrite (y/n)? y 既に鍵があれば上書き
Enter passphrase (empty for no passphrase): してよいか尋ねられる
Enter same passphrase again:
Your identification has been saved in /home/oresama/.ssh/id_rsa.
Your public key has been saved in /home/oresama/.ssh/id_rsa.pub.
The key fingerprint is:
2d:XX:c6:25:01:0a:29:XX:b2:a7:59:XX:dc:ad:XX:29 oresama@dev00.example.com
The key's randomart image is: