ssh 公開鍵認証
sshd_config 設定 ( ssh接続で鍵の利用を許可する)
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PermitRootLogin no
PasswordAuthentication no
resolv.conf 設定 (yumコマンドが使えるように設定)
/etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 127.0.0.1
ログインユーザーのホームディレクトリ(~/.ssh)に
# RSA1鍵を作成(ssh version1)
ssh-keygen -t rsa1
#DSA鍵を作成(ssh version2)
ssh-keygen -t dsa
permissionの設定
cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
作成済みの秘密鍵のパスワードを変更する場合
ssh-keygen -p -f ~/.ssh/id_rsa
Enter old passphrase: (旧パスワード)
Key has comment '~/.ssh/id_rsa'
Enter new passphrase (empty for no passphrase): (新パスワード)
Enter same passphrase again: (新パスワード)
Your identification has been saved with the new passphrase.