Hardening the SSH Server
Lock down your SSH server by editing sshd_config: disable root and password logins, change risky defaults, restrict users, and apply layered protections so only trusted clients can connect.
Why Harden SSH?
An SSH server exposed to the internet is a constant target for automated attacks. Default settings leave several doors open that bots probe relentlessly.
Hardening means tightening the server-side configuration so that even if attackers find your server, they cannot brute-force their way in.
The sshd_config File
Server-side SSH behavior is controlled by /etc/ssh/sshd_config. This is different from the client config you configured earlier (~/.ssh/config).
Always edit it as root and keep a backup before making changes.
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
sudo nano /etc/ssh/sshd_configAll lessons in this course
- Understanding the SSH Protocol
- Configuring Your SSH Client
- SSH Key-Based Authentication
- Hardening the SSH Server