**RSAキーの作成手順 [#xec79ab7]
sshを用いたリモートログインの認証にキーファイル+パスフレーズを用いる場合は、以下の手順にてキーファイルの作成を行なう。~
-RSA1対応のキーファイル作成(TeraTermPro等向け)~
RSAキーを作成するユーザにスイッチし、下記の手順を実行する。~
cd ~
ssh-keygen -t rsa1
Enter file in which to save the key (/home/[USER]/.ssh/identity): < RSAキーの保管場所
Enter passphrase (empty for no passphrase): < パスフレーズを入力
Enter same passphrase again: < 再入力
Your identification has been saved in /home/k-arai/.ssh/
cd .ssh
cp identity.pub authorized_keys
chmod 600 authorized_keys
秘密鍵(identity)は任意の名称に変更し、ローカルマシンに移動させる。~
以後、認証の際には秘密鍵の指定とパスフレーズの入力でログイン可能となる~
**ssh-keygenの設定内容 [#c007d82a]
ssh-keygenの使用方法は以下となる。
ssh-keygen [option]
optionには以下の暗号方式の指定を行なう必要がある。指定方法は以下の通り。
ssh-keygen -t rsa1 RSA protocol 1による暗号化
ssh-keygen -t rsa2 RSA protocol 2による暗号化
ssh-keygen -t dsa DSAによる暗号化
キーファイルは各ユーザのホームディレクトリ配下の.sshに作成される。ファイル名は指定した暗号によって以下となる。 ~
|identity.pub|RSA protocol 1 公開鍵|
|identity|RSA protocol 1 秘密鍵|
~
|id_rsa.pub|RSA protocol 2 公開鍵|
|id_rsa|RSA protocol 2 秘密鍵|
~
|id_dsa.pub|DSA 公開鍵|
|id_dsa|DSA 秘密鍵|