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.
This commit is contained in:
parent
ad25ef919d
commit
dd5fb3e3f8
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user