From 804fe9b9fc98c5997182d0d275f710fc94b94329 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Wed, 23 Sep 2020 15:58:57 +0800 Subject: [PATCH] Permit root login #3 --- netboot.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/netboot.sh b/netboot.sh index cc176de..01d9844 100644 --- a/netboot.sh +++ b/netboot.sh @@ -433,6 +433,13 @@ if [ -n "$DEBI_KERNEL_PARAMS" ]; then echo "d-i debian-installer/add-kernel-opts string$DEBI_KERNEL_PARAMS" | $save_preseed fi +if [ "$DEBI_USERNAME" = root ]; then + $save_preseed << 'EOF' +d-i preseed/late_command string \ + in-target sed -ri 's/^#?PermitRootLogin .+/PermitRootLogin yes/' /etc/ssh/sshd_config +EOF +fi + $save_preseed << EOF # Finishing up the installation