ずいぶん昔にUbuntu14.04で構築したsshサーバーの設定内容をコピーして、今回Ubuntu18.04で反映したら、エラーが表示されてしまった。バージョンが上がって微妙に内容が変わっているようなので、また備忘録として残しておく。
sshd_configの設定内容のテスト
設定内容が正しく動作するかは、ssh -t
で事前テストできる。実際に反映した内容をテストしたところ以下のようになった。
> sudo /usr/sbin/ssh -t
/etc/ssh/sshd_config line 131: Deprecated option RSAAuthentication
- RSAAuthenticationがDeprecatedになった
どうも現在はv2に完全移行しているようで、以下のオプションはもういらないらしい。
Protocol 2
RSAAuthentication yes
変更したパラメータのまとめ
https://euske.github.io/openssh-jman/sshd_config.html
Port 23 # sshサーバーのポート
PermitRootLogin no # rootでログイン不可
PubkeyAuthentication yes # 公開鍵での認証を有効
AuthorizedKeysFile .ssh/authorized_keys # 公開鍵を格納しているファイル名
PasswordAuthentication no # パスワード認証不可
X11Forwarding yes # X11転送を拒否
設定を反映するために再起動
> sudo systemctl restart ssh