Update Ubuntu version, add missing commands (#944)

This commit is contained in:
Luke Fisk-Lennon 2022-05-15 04:14:24 +10:00 committed by GitHub
parent 21716a766e
commit b881492350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -6,7 +6,7 @@ menu:
parent: admin
---
If you are setting up a fresh machine, it is recommended that you secure it first. Assuming that you are running **Ubuntu 18.04**:
If you are setting up a fresh machine, it is recommended that you secure it first. Assuming that you are running **Ubuntu 20.04**:
## Do not allow password-based SSH login \(keys only\)
@ -14,6 +14,10 @@ First make sure you are actually logging in to the server using keys and not via
Edit `/etc/ssh/sshd_config` and find `PasswordAuthentication`. Make sure its uncommented and set to `no`. If you made any changes, restart sshd:
```bash
systemctl restart ssh.service
```
## Update system packages
```bash
@ -22,6 +26,12 @@ apt update && apt upgrade -y
## Install fail2ban so it blocks repeated login attempts
First, install fail2ban:
```bash
apt install fail2ban
```
Edit `/etc/fail2ban/jail.local` and put this inside:
```text