DEV Community

olivia Millie for eServers

Posted on • Originally published at eservers.uk

The SSH Security Hardening Checklist for Dedicated Servers

When you rent a dedicated server, you get full root access — which also means SSH is the front door to your entire infrastructure. Unlike shared hosting, there's no provider-managed layer sitting between an attacker and your operating system. If SSH is left on default settings, it becomes the single easiest way for automated bots to get in.

This checklist walks through the practical steps for hardening SSH on Bare Metal Servers, why each step matters, and where responsibility sits.

Why SSH Security Matters More on a Dedicated Server

On a dedicated server, you are the system administrator. Every internet-facing dedicated server with SSH open on port 22 will see automated login attempts within hours of going live. The good news: fixing default ports, password-only logins, and root access closes the majority of the attack surface.

The SSH Hardening Checklist

1. Disable direct root login
Root is the most targeted username. Create a separate administrative user with sudo privileges, then set PermitRootLogin no in sshd_config.

2. Switch to key-based authentication
SSH keys are far harder to brute-force than passwords. Generate an SSH key pair and install the public key on the server.

3. Disable password authentication entirely
Once key-based login is working, set PasswordAuthentication no. This alone eliminates brute-force password guessing.

4. Change the default SSH port
Moving off port 22 won't stop a targeted attacker, but it dramatically cuts down the noise from automated scanners.

5. Restrict SSH access by IP address
Use firewall rules or AllowUsers/Match Address directives to only permit SSH from known IP ranges.

6. Use fail2ban or equivalent
Fail2ban watches your logs and automatically bans IPs after repeated failed login attempts.

7. Set an idle session timeout
Configure ClientAliveInterval and ClientAliveCountMax so idle SSH sessions disconnect automatically.

8. Limit which users can use SSH
Use AllowUsers or AllowGroups in sshd_config to explicitly list who is permitted to connect.

9. Keep OpenSSH and the OS patched
Apply OS and OpenSSH security updates promptly.

10. Monitor and log SSH access
Review /var/log/auth.log (Debian/Ubuntu) or /var/log/secure (RHEL-based) periodically.

11. Consider two-factor authentication (2FA)
For servers handling sensitive databases on NVMe Dedicated Servers, adding 2FA via Google Authenticator PAM modules provides a second layer.

Combining SSH Hardening with Network-Level Protection

SSH hardening works best alongside a dedicated hardware firewall. Hosting your infrastructure in a secure London Data Centre with edge-level DDoS mitigation reduces the volume of malicious traffic your SSH daemon ever has to deal with.

Read the original guide here: https://www.eservers.uk/blogs/ssh-security-hardening-checklist/

Top comments (0)