Kaynağa Gözat

Disable root log in without password

Co-Authored-By: Jakub Jirutka <jakub@jirutka.cz>
Derek McEachern 3 yıl önce
ebeveyn
işleme
79cac5edcf
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      alpine-make-rootfs

+ 3 - 0
alpine-make-rootfs

@@ -399,6 +399,9 @@ if ! [ -f "$rootfs"/etc/alpine-release ]; then
 	fi
 fi
 
+# Disable root log in without password.
+sed -i 's/^root::/root:*:/' "$rootfs"/etc/shadow
+
 [ -e "$rootfs"/var/run ] || ln -s /run "$rootfs"/var/run
 
 #-----------------------------------------------------------------------