Most server hardening advice ends with “now check your config”. Checking means reading sshd_config, remembering that files in sshd_config.d can override it, knowing which defaults apply to settings nobody wrote down, and then running ss and working out what each port is. It’s easy to skip, so it gets skipped.
server-check does that part. It reads the settings sshd actually uses and the ports that are actually listening, then lists what to fix in plain English, with the line to fix it. It’s free, MIT licensed, and the source is on GitHub. server-check on GitHub alsops-server-check on npm
Run it
You need Node.js 18 or newer on the server. Run it with sudo, because sshd -T only works as root and ss shows program names only to root:
sudo npx alsops-server-check If Node came from nvm, sudo won’t find npx (“sudo: npx: command not found”), because root’s PATH doesn’t include your nvm folder. Pass your PATH through:
sudo env PATH="$PATH" npx alsops-server-check It reads two things: the output of sshd -T, which is the final configuration after every include and default, and the output of ss -tulpn (or netstat -tulpn where ss is missing). Nothing is sent anywhere, and it changes nothing on the server.
What the report looks like
This is part of the report for a typical new VPS: root login and passwords still on, an older key exchange list, and Redis listening on every interface.
SSH settings [HIGH] Root can log in over SSH PermitRootLogin is yes. Attackers try "root" first, and a root login skips the audit trail of sudo. Fix: PermitRootLogin no [HIGH] Password logins are allowed PasswordAuthentication is yes. Internet-facing servers get password-guessing attempts within minutes of going online. Fix: PasswordAuthentication no [MEDIUM] No post-quantum key exchange Neither mlkem768x25519-sha256 nor sntrup761x25519-sha512 is offered, ... Fix: KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,curve25519-sha256 Put the fixes in /etc/ssh/sshd_config.d/00-hardening.conf, then run: sudo sshd -t && sudo systemctl reload ssh Listening ports [CRITICAL] 6379/tcp Redis (redis-server) on 0.0.0.0 Redis open to the internet is routinely taken over to install cryptominers, especially without a password. Open on every network interface, so reachable from the internet unless a firewall blocks it. Fix: Set bind 127.0.0.1 -::1 and protected-mode yes in redis.conf, and set a password. [OK] 5432/tcp PostgreSQL (postgres) on 127.0.0.1 Each finding has a severity, a reason in one or two sentences and a fix. SSH fixes are sshd_config lines, collected so you can put them in one drop-in file and test them with sshd -t before reloading. Keep your current session open until a new login works.
What it checks
| Area | Checks |
|---|---|
| SSH logins | Root login, password and keyboard-interactive logins, including passwords that still get through PAM, and whether AllowUsers or AllowGroups limit who can log in |
| SSH crypto | Weak ciphers, MACs and key exchange, SHA-1 and DSA signatures, and missing post-quantum key exchange (mlkem768x25519-sha256 or sntrup761x25519-sha512) |
| SSH extras | Agent, TCP and X11 forwarding, MaxAuthTries and LoginGraceTime |
| Ports | What each listening port is (about 70 common services, matched by port and program name) and whether it’s open on a public interface |
| Risky services | Databases, Redis, Memcached, Elasticsearch, the Docker API, CUPS and similar services listening on 0.0.0.0, and published Docker ports that skip UFW |
The SSH checks follow current OpenSSH guidance. For the reasoning behind each setting, the SSH hardening guide goes through them one by one. SSH hardening guide
Use it in scripts and CI
server-check exits with code 2 when it finds anything critical or high, and 0 otherwise, so a provisioning script or a CI job can fail on it. --json prints the findings as JSON for anything that wants to read them:
sudo env PATH="$PATH" npx alsops-server-check --json > report.json echo $? # 2 if something critical or high was found | Option | What it does |
|---|---|
| --json | Machine-readable output |
| --ssh-only | Only check SSH |
| --ports-only | Only check listening ports |
| --no-color | Plain text (it also honours NO_COLOR) |
What it doesn’t do
“Reachable” means open on a public interface. A cloud firewall or security group may still block the port, and server-check can’t see that from inside the server. Test from another machine with nc -zv to be sure.
It checks global sshd settings only, not Match blocks, so a Match block that turns passwords back on for one user or network won’t show up. And it’s a one-time check: it tells you about today, not about the login that happens tonight.
No terminal handy?
The same checks run in your browser. Paste sshd -T output into the SSH config checker, or ss -tulpn output into the open ports explainer. Nothing you paste leaves the page. SSH config checker Open ports explainer
For around-the-clock watching instead of a one-time check, Vigilhold, our host agent for Linux servers, watches SSH, processes, network connections and file changes on every server from one console. There’s a 14-day trial with no card. See Vigilhold
The short version
| Step | Command |
|---|---|
| Run the check | sudo npx alsops-server-check |
| Node from nvm | sudo env PATH="$PATH" npx alsops-server-check |
| Apply SSH fixes | Put them in /etc/ssh/sshd_config.d/00-hardening.conf, then sudo sshd -t && sudo systemctl reload ssh |
| Confirm a port is closed | nc -zv from another machine |
| Fail a CI job on findings | Exit code 2 means critical or high |
server-check is open source. Read the code, file an issue, or send a fix on GitHub.
Originally published on the Al's-Ops blog.
![[CVE-2026-116331] Deep Dive - How One SORTOP Handed Over PostgreSQL](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmceztdcf80os633lbll3.png)
