Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VPS Setup

A robust, idempotent bash script to quickly setup a fresh & secure Ubuntu 24.04 VPS with tailscale.

Features

  • Fully automated and idempotent (safe to run multiple times).
  • System update and package installation.
  • Configurable unprivileged user creation with sudo access.
  • Secure SSH hardening (disables root login, password auth).
  • UFW firewall configuration with safe defaults (Tailscale access).
  • Tailscale installation.

Prerequisites

  • A fresh Ubuntu VPS.
  • Logged in as root.

Usage

You can run the script with a single command from your VPS as root:

curl -fsSL https://raw.githubusercontent.com/vassista/vps-setup/main/setup-vps.sh | bash

Warning

Please review the script before running it directly to understand the configuration changes it makes.

Customization

To customize the script (e.g., change the username), clone the repository, edit setup-vps.sh, and run it locally:

git clone https://github.com/vassista/vps-setup.git
cd vps-setup
# Edit setup-vps.sh to change USERNAME="your_username"
./setup-vps.sh

Architecture

The setup process is orchestrated by setup-vps.sh and broken down into modular scripts inside the scripts/ directory:

  • update.sh: Updates the system using apt.
  • packages.sh: Installs necessary utilities.
  • user.sh: Creates an unprivileged user and sets up SSH keys.
  • ssh.sh: Hardens the SSH daemon configuration.
  • tailscale.sh: Installs Tailscale.
  • firewall.sh: Configures UFW.
  • verify.sh: Prints verification information.

Troubleshooting

  • SSH Access: If you lose SSH access, ensure that the authorized keys were properly copied to the new user. You may need to access your VPS through the provider's web console.
  • Tailscale: The script installs Tailscale but requires manual authentication. Run sudo tailscale up --ssh after the script completes to connect the VPS to your tailnet.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages