公開鍵認証のみでrootログインを不可にする
- 一般ユーザーを作る
- 一般ユーザーのauthorize_keysに公開鍵を登録
- authorize_keysのパーミッションは600
- rootパスワード変更
- sshd_config
- 疎通確認
sshd_configの変更内容は、
# diff sshd_config_org sshd_config
42c42
< #PermitRootLogin yes
---
> PermitRootLogin no
64c64
< #PasswordAuthentication yes
---
> PasswordAuthentication no
66c66
< PasswordAuthentication yes
---
> #PasswordAuthentication yes