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 ````