A new cloud or VPS server should not go straight from provisioning to production. This server-hardening checklist gives you a practical sequence for securing SSH, administrator accounts, updates, firewall rules, services, permissions, logs, backups, and recovery access—then shows what to review monthly and quarterly.
Overview
Server hardening is the process of reducing avoidable attack paths and making failures easier to detect and recover from. It applies whether you run a small business website, a managed application, a database, or a development environment on cloud hosting or VPS hosting.
The safest approach is staged. First preserve an emergency access path, then create named administrator accounts, secure SSH, apply updates, restrict network exposure, remove unnecessary services, and confirm that monitoring and backups work. Avoid making several access changes at once without testing them; a firewall or SSH mistake can lock out legitimate administrators.
Record the server's operating system, hostname, public addresses, provider console path, installed services, administrator owners, backup destination, and recovery procedure. Store this inventory somewhere separate from the server. It becomes especially valuable during an outage, rebuild, ownership change, or security audit.
Hardening is not a one-time configuration. New packages, users, applications, ports, certificates, and deployment methods change the server's risk profile. Treat the checklist as a baseline and keep evidence of each review.
What to track
1. Emergency access and administrator accounts
- Confirm that the cloud-provider console, serial console, or equivalent recovery channel works before changing SSH settings.
- Create a named administrative account for each person who needs access. Avoid sharing a single personal login.
- Use least privilege where practical. Reserve full root or administrator access for tasks that require it.
- Remove former administrators promptly and review accounts created by automation, control panels, or deployment tools.
- Keep a documented break-glass procedure, including who can approve its use and how access is reviewed afterward.
On Linux, administrative access is commonly delegated through a privilege tool such as sudo. The exact commands and group names vary by distribution, so verify them against the operating system documentation. Test the new account in a second session before closing the original connection.
2. SSH security
Prefer individual SSH keys over passwords. Protect private keys on administrator devices with a passphrase and avoid copying them to the server. If your environment supports it, require hardware-backed or centrally managed authentication for higher-risk systems.
Review the SSH daemon configuration for these controls:
- Disable direct root login after confirming that a tested administrative account works.
- Disable password authentication only after key-based access has been verified in a separate session.
- Restrict which users or groups may connect.
- Use a non-default port only as a minor noise-reduction measure, not as a substitute for authentication and firewall controls.
- Set idle-session and authentication limits that suit your operational needs.
After editing the configuration, validate its syntax before restarting the service. Keep the existing session open, start a second test connection, and check the service status. A configuration change that appears secure but removes your only access path is an operational failure.
3. Updates, packages, and services
Apply available operating-system security updates before installing the application stack. Configure automatic security updates where they are compatible with your workload, or define a manual patch window with an owner and a rollback plan. Automatic updates should not replace testing, maintenance notifications, or backup verification.
List installed packages and active services. Remove software you do not need, disable unused listeners, and avoid installing broad control panels or administration tools unless their features are required. Every active service should have a purpose, an owner, a patching method, and a known listening address.
For deployment-related guidance, compare this checklist with the Git-based website deployment workflow, particularly its treatment of environments, secrets, and release checks.
4. Firewall rules and exposed ports
Use both the cloud provider's network firewall or security group and the operating-system firewall when your design calls for layered controls. Start with a default-deny inbound policy, then allow only the traffic the application needs. Common examples include SSH from approved administration sources, HTTPS for a public website, and HTTP only when it is needed for redirects or certificate validation.
Do not expose databases, caches, admin dashboards, internal APIs, or metrics endpoints to the public internet by default. Permit them only from the application network, a private address range, a VPN, or a tightly controlled administrator source. Review both IPv4 and IPv6 rules; securing one address family does not automatically secure the other.
Tools such as UFW, firewalld, nftables, or provider-specific controls use different syntax. Before applying a rule, document the intended source, destination, protocol, port, and business reason. Then test from an allowed source and an intentionally unapproved source.
5. Files, secrets, TLS, and logs
Set application files and directories to the least permissive ownership and mode that still allows the service to run. Do not make configuration files, private keys, environment files, upload directories, or backup archives globally readable or writable. Keep secrets out of source repositories and deployment logs, and rotate credentials when access changes or exposure is suspected.
For public services, use valid TLS and redirect insecure application traffic where appropriate. Certificate installation and renewal should be tested rather than assumed; the SSL certificate hosting guide covers installation, renewal, and mixed-content checks.
Enable authentication logs, system logs, web-server logs, and application logs at a useful level. Forward important logs to a separate location when possible, protect them from unauthorized alteration, and define a retention period that supports investigation without consuming all available disk space.
6. Backups and recovery
A backup is only useful if it can be restored. Track backup scope, schedule, retention, encryption, destination, last successful run, and last completed restore test. Include databases, uploads, configuration, deployment information, and encryption keys where appropriate; a disk image alone may not restore the application cleanly.
Separate backup credentials from normal server credentials. If ransomware or an administrator mistake is in scope, keep at least one recovery copy outside the server's direct control. Use the backup and restore plan as a reference for scheduling, retention, and recovery testing.
| Area | Evidence to record | Review question |
|---|---|---|
| SSH and accounts | Users, keys, groups, configuration test | Can each user access only what they need? |
| Firewall | Allowed ports and source ranges | Is every exposed port necessary and owned? |
| Updates | Last update, pending updates, reboot status | Is a security update waiting for action? |
| Services | Active services and listening sockets | Does each listener have a documented purpose? |
| Backups | Last success and restore-test result | Could the service be rebuilt from available data? |
Cadence and checkpoints
Use a monthly review for fast-changing access and operational items:
- Review administrator accounts, SSH keys, API tokens, and recent privileged logins.
- Check pending operating-system and application updates.
- Compare listening ports with the approved inventory.
- Confirm firewall rules, certificate status, disk space, and log collection.
- Check that backups completed and that failures generated an alert.
Use a quarterly review for deeper controls:
- Perform a restore test and record how long recovery took.
- Review file ownership, service permissions, secrets, and deployment credentials.
- Test provider-console or break-glass access without changing production unnecessarily.
- Inspect cloud firewall rules, private networking, snapshots, and unused resources.
- Compare the running configuration with the documented baseline and remove exceptions that no longer have an owner.
Recheck the server after every rebuild, migration, major application release, new administrator, provider-network change, or incident. A new domain or DNS change may not alter the server itself, but it can expose a previously private endpoint; use the DNS records reference when verifying public exposure.
How to interpret changes
Not every change is an incident, but unexplained change deserves investigation. A new listening port may be a legitimate release dependency or an unauthorized service. A new administrator may be expected after onboarding or may indicate account compromise. Repeated failed logins may reflect background internet scanning, but a successful login from an unfamiliar source requires prompt review.
Use a simple change record with four fields: what changed, when it changed, who authorized it, and how it was verified. Compare alerts with deployment records, provider activity logs, package history, and application releases before drawing conclusions. Preserve relevant logs before restarting or rebuilding a suspected system.
Prioritize findings by exposure and consequence. An internet-facing administrative interface, an unpatched public service, an unknown privileged account, or a failed backup restore test generally deserves faster action than a documentation gap. If compromise is plausible, isolate the affected service where feasible, preserve evidence, rotate exposed credentials from a trusted device, and follow your incident-response plan rather than deleting everything immediately.
When to revisit
Revisit this server-hardening checklist monthly for access, updates, ports, certificates, logs, and backup status. Complete the broader audit quarterly, and update the checklist whenever your Linux distribution, SSH implementation, firewall tooling, TLS configuration, control panel, or cloud-provider security features change materially. Security guidance and recommended defaults evolve, so review the relevant operating-system and tool documentation before applying configuration changes.
Make the next review actionable: assign an owner, set a date, attach the current inventory, and record exceptions with an expiry date. If a server cannot be restored, if no one can explain an exposed port, or if privileged access cannot be traced to a named person, treat that as unfinished hardening—not merely a paperwork issue. A short, repeatable review is more useful than a detailed checklist that no one returns to.