Updated root nologin command

This commit is contained in:
mic0 2025-11-26 18:19:04 +01:00
parent e168e78b31
commit 70a815b135
No known key found for this signature in database
GPG Key ID: 8E103C91321755A8

View File

@ -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. The following commands will lock out the root by configuring `/etc/ssh/sshd_config` file.
```sh ```sh
sed -i 's/PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config && sed -i '/^PermitRootLogin/c\PermitRootLogin no' /etc/ssh/sshd_config
sed -i 's/#PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config && sed -i '/^PasswordAuthentication/c\PasswordAuthentication no' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config &&
systemctl restart sshd systemctl restart sshd
```` ````