Something went wrong. Try again.
Harden a fresh Debian VPS: SSH, fail2ban, UFW, BBR, unattended-upgrades. One command.
Something went wrong. Try again.
Files
- HTML 61%
- Shell 39%
README.md
VPS Setup Tool #
Provision and harden a fresh Debian 13 VPS in one command. No app included - bring your own. This is the scaffolding layer.
What it does #
setup.sh (runs on your machine):
- Verifies SSH reachability
- Waits for
cloud-initto finish - Forces DNS to public resolvers, swaps apt sources, installs base tools
- Uploads
bootstrap.sh+harden.shto the target - Runs them in order
bootstrap.sh (runs on the VPS):
- Installs
nginx,ufw,fail2ban,unattended-upgrades,python3,git,curl,wget,rsync,ca-certificates,sqlite3 - Generates an nginx security-headers snippet (HSTS, CSP, COOP/CORP, etc.) and a dotfile-deny rule that leaves
/.well-known/reachable - Creates
/var/www/acmeand adds alocation ^~ /.well-known/acme-challenge/block, so ACME HTTP-01 challenges (certbot, acme.sh, lego) resolve without editing nginx - Generates a placeholder nginx site - either a static 200 or a reverse proxy to a configurable port
- Generates a skeleton
systemdunit template at/etc/systemd/system/app.service.template - Enables the site, verifies
nginx -t
harden.sh (runs on the VPS):
- SSH daemon hardening (drop-in
00-hardening.conf) - ssh-audit cipher/KEX/MAC hardening
- MOTD + LastLog suppression
- fail2ban (
sshdaggressive +recidivejail, UFW banaction) - sysctl: kernel hardening + BBR + fq + TCP tuning
- unattended-upgrades
- UFW: deny in, allow 22/80/443, rate-limit 22
Requirements #
- Target: fresh Debian 13 (trixie) or similar
- Root SSH access with
authorized_keyspopulated - Local:
bash,rsync,ssh,tar
Usage #
bash setup.sh [options] <ssh-target>