No description
- Shell 100%
| LICENSE | ||
| new-server-setup-script.sh | ||
| README.md | ||
new-server-setup
Bootstrap script for hardening a fresh or existing Debian/Ubuntu server. Safe to re-run.
What it does
- Sets the hostname
- Creates a new sudo user with a password and SSH public key
- Sets a classic
user@hostname:~$shell prompt - Hardens
sshd— disables root login and password auth, moves SSH to a random port (1024–65535) - Installs and enables
fail2banwith a sensible SSH jail - Opens the new SSH port in
ufw(if present)
After setup, prints ready-to-run commands to push your Ghostty terminfo and test the new login.
Usage
bash <(curl -fsSL https://git.tylerdavis.net/tyler/new-server-setup/raw/branch/main/new-server-setup-script.sh)
The script prompts interactively for username, hostname, password, and SSH public key before making any changes.
Re-running
The script is idempotent. If the SSH port has already been changed from 22, it will be kept as-is. User creation, SSH key, and PS1 steps are all skipped if already applied.
Requirements
- Debian/Ubuntu-based server
- Initial root or sudo SSH access