RSAキーの作成手順

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の設定内容

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.pubRSA protocol 1 公開鍵
identityRSA protocol 1 秘密鍵


id_rsa.pubRSA protocol 2 公開鍵
id_rsaRSA protocol 2 秘密鍵


id_dsa.pubDSA 公開鍵
id_dsaDSA 秘密鍵

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS