From 01043c97c122d29c2e13d4a06a6906647f454e92 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Sat, 21 Nov 2020 05:57:55 +0000 Subject: [PATCH] Update --- debi.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debi.sh b/debi.sh index 31acb59..06356c4 100755 --- a/debi.sh +++ b/debi.sh @@ -283,7 +283,7 @@ EOF if [ -n "$authorized_keys_url" ]; then backup /etc/ssh/sshd_config - run_later 'sed -Ei "s/^#?PasswordAuthentication .+/PasswordAuthentication no/" /etc/ssh/sshd_config' + run_later 'sed -Ei "s/^#?PasswordAuthentication.*/PasswordAuthentication no/" /etc/ssh/sshd_config' $save_preseed << EOF d-i network-console/password-disabled boolean true d-i network-console/authorized_keys_url string $authorized_keys_url @@ -342,7 +342,7 @@ EOF if [ "$username" = root ]; then if [ -z "$authorized_keys_url" ]; then backup /etc/ssh/sshd_config - run_later 'sed -Ei "s/^#?PermitRootLogin .+/PermitRootLogin yes/" /etc/ssh/sshd_config' + run_later 'sed -Ei "s/^#?PermitRootLogin.*/PermitRootLogin yes/" /etc/ssh/sshd_config' else run_later "mkdir -m 0700 -p ~root/.ssh && busybox wget -O - \"$authorized_keys_url\" >> ~root/.ssh/authorized_keys" fi @@ -362,7 +362,7 @@ EOF fi else backup /etc/ssh/sshd_config - run_later 'sed -Ei "s/^#?PermitRootLogin .+/PermitRootLogin no/" /etc/ssh/sshd_config' + run_later 'sed -Ei "s/^#?PermitRootLogin.*/PermitRootLogin no/" /etc/ssh/sshd_config' if [ -n "$authorized_keys_url" ]; then run_later "sudo -u $username mkdir -m 0700 -p ~$username/.ssh && busybox wget -O - \"$authorized_keys_url\" | sudo -u $username tee -a ~$username/.ssh/authorized_keys"