Adjust sed to apply to uncommented PermitRootLogin in /etc/ssh/sshd_config
In some Debian distributives (i.e. Debian 12 standard bookworm image used in GCP) `PermitRootLogin` is already uncommented; the regex in the exercise would skip it. The suggested change will act upon either uncommented line or commented.pull/821/head
parent
5a325c23d7
commit
94ed6d3b77
|
@ -44,7 +44,7 @@ Edit the `/etc/ssh/sshd_config` SSH daemon configuration file and set the `Permi
|
|||
|
||||
```bash
|
||||
sed -i \
|
||||
's/^#PermitRootLogin.*/PermitRootLogin yes/' \
|
||||
's/^#*PermitRootLogin.*/PermitRootLogin yes/' \
|
||||
/etc/ssh/sshd_config
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue