Your security team wants SSH hardened on all servers. What changes do you make?
BeginnerScenarioNetworking, SSH and remote access
Answer
Situation read → Disable weak paths, limit who can log in.
What I'd do →
/etc/ssh/sshd_config.d/10-hardening.conf:
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
AllowGroups ssh-users
MaxAuthTries 3
LoginGraceTime 30
X11Forwarding no
Then sudo sshd -t && sudo systemctl reload sshd, and test from a second session before closing the first.
Why → Keys plus no root plus a group allowlist removes the most common brute-force and misuse paths.
Interview tip → Always keep an existing session open while changing sshd; that's the lockout insurance.
More on Networking, SSH and remote access
A key belonging to a departed engineer may be in `authorized_keys` on 300 servers. How do you rotate SSH keys across the fleet?IntermediateYou need to reach a database on a private subnet from your laptop through a bastion. How?BeginnerA new server needs a static IP, gateway and DNS on RHEL 9. How do you configure it persistently?BeginnerYou're changing the network config of a remote server over SSH and could lose access. How do you protect yourself?IntermediateA web server should accept HTTP/HTTPS from anywhere but SSH only from the office. Configure the firewall.BeginnerYour app servers need to reach the internet for updates but must not be reachable from it. How do you set it up on a Linux gateway?Intermediate