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
Eugene Abramchuk 2024-11-29 18:05:58 +01:00 committed by GitHub
parent 5a325c23d7
commit 94ed6d3b77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ Edit the `/etc/ssh/sshd_config` SSH daemon configuration file and set the `Permi
```bash ```bash
sed -i \ sed -i \
's/^#PermitRootLogin.*/PermitRootLogin yes/' \ 's/^#*PermitRootLogin.*/PermitRootLogin yes/' \
/etc/ssh/sshd_config /etc/ssh/sshd_config
``` ```