Interview Prep/Linux/SSH & Access Hardening

What are the first sshd_config changes you make on a new production server?

BeginnerProductionSSH & Access Hardening
Answer
# /etc/ssh/sshd_config.d/10-hardening.conf
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
LoginGraceTime 30
X11Forwarding no
AllowGroups ssh-users
ClientAliveInterval 300
ClientAliveCountMax 2
sudo sshd -t && sudo systemctl reload ssh   # 'sshd' on RHEL

Keep your current session open and test a new login before closing it.

All Linux questions Roadmap: Linux

More on SSH & Access Hardening