SSH と root ログインの強化
パスワード無効化、暗号スイート制限、鍵のみの root、fail2ban 導入——5 分で SSH リスクの 99% を除去。
公開 VPS は数分で SSH スキャンされます。NoctisNode は既定で key-only 供給ですが、数行追加すれば総当たりは無意味化。
sshd_config
# /etc/ssh/sshd_config.d/hardened.conf
PermitRootLogin prohibit-password
PasswordAuthentication no
KbdInteractiveAuthentication no
AllowUsers root deploy
MaxAuthTries 3fail2ban
apt install -y fail2ban
printf '[sshd]\nenabled = true\nmaxretry = 3\nbantime = 3600\n' > /etc/fail2ban/jail.d/sshd.conf
systemctl enable --now fail2banチェックリスト
- ▹Ed25519 鍵を使用。記憶より古い RSA 鍵は引退させる。
- ▹ポート 22 移動は『スキャナからは隠れるが攻撃者からは隠れない』を理解した上で。
- ▹締め出される前に第2のログイン経路(コンソール/VNC)を確保。