From 0963a650748fc73ff49484c1ffc68a9c0cab3ab6 Mon Sep 17 00:00:00 2001 From: Christopher Date: Wed, 25 Oct 2023 21:07:41 -0500 Subject: [PATCH] Change PermitRootLogin to yes even if it's commented out --- enable-ssh-on-pve-lxc/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..."