SEC.01
The playbook
The run starts read-only: the recon probes decide what happens next. The steps that follow are adapted to the distribution and state found — a real machine is rarely clean.
- 01recondistro and OpenSSH version (KbdInteractiveAuthentication ≥ 8.7)
- 02reconthe effective SSH config (port, root, password, key location)
- 03recondoes sshd_config include sshd_config.d/? which drop-ins exist (50-cloud-init.conf may re-enable passwords)?
- 04reconwhich accounts have authorized keys and which are sudoers (no key → DO NOT turn off passwords)
- 05reconTOTP 2FA in place? (then keep KbdInteractiveAuthentication)
- 06reconunit name: ssh (Debian/Ubuntu), sshd (RHEL), ssh.socket (socket activation)
- 07reconis the SSH config valid before touching it?
- 08actBack up sshd_configverify
- 09actInclude sshd_config.d (only if the Include is missing)verify
- 10actTurn off root password login + password logindestructiveverify
- 11actCheck the effective config before reloadingverify
- 12actReload sshd (without dropping sessions)destructiveverify
SEC.02
What it verifies
Each step ships its own check. The run only moves on when the check passes, so what the recipe reports as done is what is actually on the server.
- 01verifyBack up sshd_configVerified by
ls -1 /etc/ssh/sshd_config.bak.* | tail -1 - 02verifyInclude sshd_config.d (only if the Include is missing)Verified by
grep -cE '^\s*Include\s+/etc/ssh/sshd_config.d/' /etc/ssh/sshd_config && sshd -t && echo ok - 03verifyTurn off root password login + password loginVerified by
sshd -t 2>&1 && echo ok - 04verifyCheck the effective config before reloadingVerified by
sshd -T | grep -Ei '^(permitrootlogin|passwordauthentication) ' - 05verifyReload sshd (without dropping sessions)Verified by
systemctl is-active ssh.service sshd.service ssh.socket 2>/dev/null | grep -c '^active'
SEC.03
Guardrails
Non-negotiable instructions the run must respect, whatever it finds on the server.
REFUSE to turn off passwords if no usable account has an authorized key — you would cut access. PermitRootLogin no only if another sudoer has a key, otherwise prohibit-password. Always sshd -t before reloading; reload only, never restart or stop. Do not change the SSH port. The Servor agent does not go through SSH: if locked out, the Servor terminal can restore the backup. Ask the user to test a NEW SSH connection before closing theirs.
SEC.04
Variables
What you choose before launching — the recipe fills in the rest.
| Name | Meaning |
|---|---|
| ${root_login} | Root login |
SEC.05
How a recipe runs in Servor
Servor is zero-knowledge: the platform cannot execute anything on its own. When you launch this recipe, a run reads the reconnaissance, plans the steps and asks for your approval. Each approved command is signed by your browser — with a key the server never sees — then relayed verbatim to the agent, which verifies the signature locally before executing.
search by intent — type “firewall”, get ufw
- 01Read-only reconnaissance before any change
- 02Every command signed by your browser, approved by you
- 03Each step verified before the run moves on, every run kept in the history
SEC.06
Deploy on Servor button
Maintain Harden SSH or a project that needs it? Put this button in your README or on your site: one click and your users install it on their own server.
SEC.07
More security recipes
- 01fail2banfail2ban with the SSH jail on the right port, active and verified.
- 02UFW firewallUFW: denies incoming by default, allows the real SSH port + chosen ports, with a safety net. Destructive: keeps SSH open.
- 03Automatic security updatesEnables automatic security updates: unattended-upgrades (Debian/Ubuntu) or dnf-automatic (RHEL/Fedora).
- 04CrowdSecCrowdSec collaborative IPS, SSH collections and firewall bouncer.
- 05ClamAVClamAV antivirus with signatures kept up to date, optional daemon.
Verified recipe
Run this recipe on your server
Connect a server, launch the recipe, and approve each step as Servor executes and verifies it. Free plan, no card required.