diff --git a/enable-ssh-on-pve-lxc/run.sh b/enable-ssh-on-pve-lxc/run.sh index be9087d..a9dc681 100644 --- a/enable-ssh-on-pve-lxc/run.sh +++ b/enable-ssh-on-pve-lxc/run.sh @@ -12,7 +12,7 @@ passwd root # Enable SSH root login echo "Enabling SSH for root..." -sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config +sed -i -e 's/^#\s*PermitRootLogin.*/PermitRootLogin yes/' -e 's/^\s*PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config # Restart the SSH service echo "Restarting SSH service..."