diff --git a/content/en/admin/prerequisites.md b/content/en/admin/prerequisites.md index 5019be02..c557e92a 100644 --- a/content/en/admin/prerequisites.md +++ b/content/en/admin/prerequisites.md @@ -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 it’s 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