From dd5fb3e3f8659e2a502808a7e10b5aeed8ffb18f Mon Sep 17 00:00:00 2001 From: marcone <48169102+marcone@users.noreply.github.com> Date: Sat, 23 Sep 2023 19:14:10 -0700 Subject: [PATCH] armbian-firstlogin: allow empty user password (#5738) Call the 'passwd' command with the right arguments depending on whether the user entered a password or not. --- packages/bsp/common/usr/lib/armbian/armbian-firstlogin | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/bsp/common/usr/lib/armbian/armbian-firstlogin b/packages/bsp/common/usr/lib/armbian/armbian-firstlogin index a8649e8855..08dc2de2d7 100644 --- a/packages/bsp/common/usr/lib/armbian/armbian-firstlogin +++ b/packages/bsp/common/usr/lib/armbian/armbian-firstlogin @@ -282,7 +282,11 @@ add_user() read -r -e -p "Please provide your real name: " -i "${RealUserName^}" RealName adduser --quiet --disabled-password --home /home/"$RealUserName" --gecos "$RealName" "$RealUserName" - (echo "$first_input";echo "$second_input";) | passwd "$RealUserName" >/dev/null 2>&1 + if [[ -n "$first_input" ]]; then + (echo "$first_input";echo "$second_input";) | passwd "$RealUserName" >/dev/null 2>&1 + else + passwd -d "$RealUserName" >/dev/null 2>&1 + fi for additionalgroup in sudo netdev audio video disk tty users games dialout plugdev input bluetooth systemd-journal ssh; do usermod -aG "${additionalgroup}" "${RealUserName}" 2>/dev/null done