Title: Server Setup Script Generator | Ubuntu VPS Hardening
Open Graph Title: Server Setup Script Generator | Ubuntu VPS Hardening
Description: Generate a bash setup script for a fresh Ubuntu or Debian VPS. Hardens SSH, configures UFW, fail2ban, Docker, swap, and unattended upgrades.
Open Graph Description: Generate a bash setup script for a fresh Ubuntu or Debian VPS. Hardens SSH, configures UFW, fail2ban, Docker, swap, and unattended upgrades.
Opengraph URL: https://sshworkbench.com/tools/server-setup-script-generator
Domain: sshworkbench.com
IPv4 address: 172.67.157.29
{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is server hardening?","acceptedAnswer":{"@type":"Answer","text":"Server hardening is the process of reducing a server's attack surface by removing unnecessary services, locking down configurations, and applying security patches. On a fresh Ubuntu or Debian VPS this typically means: creating a non-root user with SSH key auth, disabling root SSH and password authentication, enabling a firewall (UFW), installing fail2ban to block brute-force attempts, turning on automatic security updates, and applying kernel/network sysctl tweaks. The script generated above performs all of those steps in one run."}},{"@type":"Question","name":"Should I disable root SSH login with password?","acceptedAnswer":{"@type":"Answer","text":"Yes. Allowing root over SSH with a password is one of the highest-risk default settings on a Linux server. Botnets continuously brute-force port 22 looking for weak root passwords. Best practice is to (1) create a non-root sudo user, (2) install your SSH public key for that user, (3) set PermitRootLogin no and PasswordAuthentication no in sshd_config. Always test your key-based login in a second terminal before closing the session that disabled password auth, otherwise you can lock yourself out."}},{"@type":"Question","name":"Is UFW enabled by default on Ubuntu?","acceptedAnswer":{"@type":"Answer","text":"No. UFW (Uncomplicated Firewall) is installed by default on Ubuntu Server but is not enabled. You have to turn it on explicitly with ufw enable. Critically, you must allow your SSH port before enabling UFW, otherwise the next time you reconnect you will be locked out. The generated script handles this for you: it always allows the active SSH port (whether 22 or your custom port) before running ufw --force enable."}},{"@type":"Question","name":"How big should a swap file be on a Linux VPS?","acceptedAnswer":{"@type":"Answer","text":"For most cloud VPS workloads a swap file of 1-2x your RAM is reasonable, capped at around 4-8 GB. A 1 GB VPS commonly uses 1-2 GB of swap, a 2 GB VPS uses 2-4 GB, and beyond ~8 GB of RAM most servers do not need much swap at all unless they hibernate (which VPSes do not). Set vm.swappiness=10 (the script does this) so the kernel only uses swap under real memory pressure rather than aggressively swapping idle pages out."}},{"@type":"Question","name":"How do unattended-upgrades work on Ubuntu?","acceptedAnswer":{"@type":"Answer","text":"unattended-upgrades is an Ubuntu/Debian package that runs in the background and automatically installs updates from configured origins (by default, just the -security pocket). It runs daily via the apt systemd timer (apt-daily.timer and apt-daily-upgrade.timer), checks the allowed origins listed in /etc/apt/apt.conf.d/50unattended-upgrades, and applies matching updates. The script enables it with security-only origins and leaves automatic reboot off, which is the safest production default."}}]}
| twitter:card | summary_large_image |
| og:type | website |
| og:site_name | SSH Workbench |
Links:
| Server | cloudflare |
| Content-Type | text/html; charset=utf-8 |
| X-Powered-By | Next.js |
| Via | 1.1 Caddy |
| Cache-Control | public, s-maxage=86400, stale-while-revalidate=604800 |
Viewport: width=device-width
Robots: index,follow