From 70a815b135f366c9c097fcfe2af52c45d61060c6 Mon Sep 17 00:00:00 2001 From: mico Date: Wed, 26 Nov 2025 18:19:04 +0100 Subject: [PATCH] Updated root nologin command --- 00_setup.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/00_setup.md b/00_setup.md index e4b58a8..8641a01 100644 --- a/00_setup.md +++ b/00_setup.md @@ -113,9 +113,8 @@ Go back to `root` account now, otherwise you will need to `sudo` the commands be The following commands will lock out the root by configuring `/etc/ssh/sshd_config` file. ```sh -sed -i 's/PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config && -sed -i 's/#PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config && -sed -i 's/PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config && +sed -i '/^PermitRootLogin/c\PermitRootLogin no' /etc/ssh/sshd_config +sed -i '/^PasswordAuthentication/c\PasswordAuthentication no' /etc/ssh/sshd_config systemctl restart sshd ````