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

+ 3 - 1
netboot.sh

@@ -329,7 +329,9 @@ if [ "$skip_account_setup" != true ]; then
 EOF
 
     if [ "$username" = root ]; then
-        _late_command 'sed -ri "s/^#?PermitRootLogin .+/PermitRootLogin yes/" /etc/ssh/sshd_config'
+        if [ -z "$authorized_keys_url" ]; then
+            _late_command 'sed -ri "s/^#?PermitRootLogin .+/PermitRootLogin yes/" /etc/ssh/sshd_config'
+        fi
         $save_preseed << EOF
 d-i passwd/root-login boolean true
 d-i passwd/make-user boolean false