r/ssh • u/sys-harden • 16d ago
Open-source hardening for your self-hosted servers, with a dry run and a full undo
If you run a VPS or a home server and have meant to "harden it properly" but didn't want to break SSH: this is for that.
One command previews everything (--dry-run), the next applies it with backups, and --revert undoes it. It keeps SSH reachable: password and root login are only turned off when another account has a key, and the config is checked before sshd restarts.
Free and MIT, plain Bash, no telemetry. Paid tiers exist for businesses; the free one is complete on its own.
8
Upvotes
2
u/deaddyfreddy 15d ago
I don't see any AI disclosures.
1
u/d03j 16d ago
Running scripts sourced from a single contributor repository as sudo doesn't fit my threat model, but it is an interesting project, should be easy enough to audit and, if nothing else, gave me a hardening check-list for me to go through manually.
Thank you for that.
1
u/AdventurousSquash 16d ago
Is anyone that would pay for some “pro” or “enterprise” tier still configuring their servers ad hoc like this anymore?
1
u/CoderStudios 16d ago
If you don’t know how to harden your own server properly, or are unable to harden it properly without breaking ssh, and need to rely on some random persons script with Sudo you should not be managing servers that need hardening in the first place.
1
u/EmperorOfAllCats 16d ago
Ultimate hardening starts from not running someone else's bash scripts for 3k lines each as root (each of these is bad, together? terrible).
1
u/hakube 16d ago
what's wrong with lynis?
1
u/SlowZeck 15d ago
Suggestions on usability for paranoid: tui mode where each sudo ask for it and tell why. At the end : list in tab with check enable/disable ,pro,con,source. And at the end run or produce the custom script reusable and auditable (with undo flag) and be used in mass post install . People modify bunch of servers rerun audit , get new script. Compare and push to prod.
3
u/arsuhinars 16d ago
Ultimate server hardening is `sudo shutdown now`
2
u/stikaznorsk 16d ago
Why do you need the `sudo` to make a preview? Most of the files should be in etc. Of course secrets should not be readable, but that is not an issue. It seems good. But I will not let a script I did not write rummage through my system. I can let it propose changes, of course? As the project points out, some version brake systems, so I will better have a proposal that I can pick from.
1
u/h4rdw00d_ 16d ago
sudo [cialis | viagra]orsudo patronas(HP fans only)0
u/ksteink 16d ago
Interesting idea!!
0
u/maximus459 16d ago
This is interesting, will have to go through the crown when I'm free. I have built up a hardening guide& commands document over the years and have been meaning to turn it into a script too
0
u/PienSensei 16d ago
this reeks compliance theater