File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Setting up & Locking Down a New VPS
2+
3+ First things to do when setting up a new VPS. For this example, I'm using a VPS running Debian 13 (Trixie).
4+
5+ # Resources
6+ - [ Syntax Youtube - Selfhost 101] ( https://youtu.be/Q1Y_g0wMwww?si=JhnX8yDgjC37uYbp )
7+
8+ # How To
9+
10+
11+ 1 . Run updates with `` apt update `` & `` apt upgrade ``
12+
13+ 2 . Install sudo if not installed with `` apt install sudo ``
14+
15+ 3 . Change root password with `` passwd ``
16+
17+ 4 . Add a new user with `` adduser {username} ``
18+
19+ 5 . Add the new user to sudo'ers group: `` adduser {username} sudo `` or `` usermod -aG sudo {username} ``
20+
21+ 6 . Setup key based SSH logins (Do the following on your personal PC)
22+
23+ 1 . Generate SSH Keys if you haven't already: `` ssh-keygen -t ed25519 ``
24+ 2 . Copy the keys over to the VPS: `` ssh-copy-id {username}@{VPS-ip-address} ``
25+
26+ 7 . Disable password login & root login.
27+
28+ ```
29+ > sudo nano /etc/ssh/sshd_config
30+
31+ Change "PasswordAuthentication" from "yes" to "no"
32+ Change "PermitRootLogin" to "no"
33+
34+ > sudo service ssh restart
35+ ```
36+
37+ 8. Install unattended-upgrades:
38+
39+ ```bash
40+ > sudo apt install unattended-upgrades
41+ > sudo dpkg-reconfigure unattended-upgrades
42+ ```
You can’t perform that action at this time.
0 commit comments