mirror of
https://github.com/mastodon/documentation
synced 2025-04-11 22:56:17 +02:00
Update Ubuntu version, add missing commands (#944)
This commit is contained in:
parent
21716a766e
commit
b881492350
@ -6,7 +6,7 @@ menu:
|
|||||||
parent: admin
|
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\)
|
## 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 it’s uncommented and set to `no`. If you made any changes, restart sshd:
|
Edit `/etc/ssh/sshd_config` and find `PasswordAuthentication`. Make sure it’s uncommented and set to `no`. If you made any changes, restart sshd:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
systemctl restart ssh.service
|
||||||
|
```
|
||||||
|
|
||||||
## Update system packages
|
## Update system packages
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -22,6 +26,12 @@ apt update && apt upgrade -y
|
|||||||
|
|
||||||
## Install fail2ban so it blocks repeated login attempts
|
## Install fail2ban so it blocks repeated login attempts
|
||||||
|
|
||||||
|
First, install fail2ban:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
apt install fail2ban
|
||||||
|
```
|
||||||
|
|
||||||
Edit `/etc/fail2ban/jail.local` and put this inside:
|
Edit `/etc/fail2ban/jail.local` and put this inside:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user