Skip to content

Commit 48ce8dc

Browse files
committed
vps first things to do
1 parent d5d12c7 commit 48ce8dc

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

docs/misc/locking_down_vps.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
```

0 commit comments

Comments
 (0)