InfraLab
SSHD_CONFIGLocal

sshd_config 推奨設定ジェネレータ

Mozilla Modern と Intermediate を元に、認証、暗号スイート、アクセス制御、セッション制限、Match ブロックを含む sshd_config を生成します。

sshd_config

Port 22
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
KexAlgorithms sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
HostKeyAlgorithms ssh-ed25519,rsa-sha2-512,rsa-sha2-256
MaxAuthTries 3
MaxSessions 10
LoginGraceTime 30s
ClientAliveInterval 300
ClientAliveCountMax 2
Subsystem sftp internal-sftp

検証コマンド

sudo sshd -t -f /etc/ssh/sshd_config && sudo systemctl reload sshd