Setting up & Locking Down a New VPS
First things to do when setting up a new VPS. For this example, I'm using a VPS running Debian 13 (Trixie).
Resources
How To
-
Run updates with
apt update&apt upgrade -
Install sudo if not installed with
apt install sudo -
Change root password with
passwd -
Add a new user with
adduser {username} -
Add the new user to sudo'ers group:
adduser {username} sudoorusermod -aG sudo {username} -
Setup key based SSH logins (Do the following on your personal PC)
- Generate SSH Keys if you haven't already:
ssh-keygen -t ed25519 - Copy the keys over to the VPS:
ssh-copy-id {username}@{VPS-ip-address}
- Generate SSH Keys if you haven't already:
-
Disable password login & root login.
-
Install unattended-upgrades: