浏览代码

Permit root login #3

Bohan Yang 5 年之前
父节点
当前提交
804fe9b9fc
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      netboot.sh

+ 7 - 0
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