Updated root nologin command
This commit is contained in:
parent
e168e78b31
commit
70a815b135
@ -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
|
||||||
````
|
````
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user