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.
This commit is contained in:
Eugene Abramchuk
2024-11-29 18:05:58 +01:00
committed by GitHub
parent 5a325c23d7
commit 94ed6d3b77

View File

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