SSH hardening config generator for sshd_config
Choose how people may log in and get a ready sshd_config drop-in or full file, plus the commands to check and apply it without locking yourself out.
Why a drop-in file
Ubuntu and Debian read every file in /etc/ssh/sshd_config.d/ before the rest of sshd_config, and sshd keeps the first value it sees. A file named 01-hardening.conf therefore wins over the defaults, including the cloud-init file that cloud images ship, and package updates leave it alone.
What matters most
- Keys instead of passwords stop almost every brute-force attempt.
- PermitRootLogin prohibit-password keeps root usable with a key. Set it to no only after you have a sudo user with a key.
- A non-standard port only cuts the noise in the logs. It is not security on its own.
Do not lock yourself out
- Always run sshd -t before reloading: it catches typos.
- Reload rather than restart, and keep the current session open while you test.
- If you do lose access on Neckrez, open the browser console from the server page in the dashboard and fix the file there.
More tools
- VPS ping test
- VPS cost calculator
- chmod calculator
- Cron generator
- Subnet calculator
- SSH key generator
- Bandwidth calculator
- What is my IP
- Cloud-init generator
- UFW firewall generator
- Fail2ban config generator
- WireGuard config generator
- Nginx reverse proxy generator
- Docker Compose generator
- Systemd service generator
- Swap size calculator
- DNS lookup