diff --git a/helpers.sh b/helpers.sh index 783ba21..f73eaea 100755 --- a/helpers.sh +++ b/helpers.sh @@ -84,10 +84,10 @@ fi sshd_config="/etc/ssh/sshd_config" if [[ "$BTCPAY_ENABLE_SSH" == "true" ]] && \ [[ -f "$sshd_config" ]] && \ - grep -Fxq "PermitRootLogin no" "$sshd_config"; then + grep -q "PermitRootLogin[[:space:]]no" "$sshd_config"; then echo "Updating "$sshd_config" (Change from 'PermitRootLogin no' to 'PermitRootLogin prohibit-password')" echo "BTCPay Server needs connection from inside the container to the host in order to run btcpay-update.sh" - sed -i 's/PermitRootLogin no/PermitRootLogin prohibit-password/' "$sshd_config" + sed -i 's/PermitRootLogin[[:space:]]no/PermitRootLogin prohibit-password/' "$sshd_config" service sshd reload fi