NuTyX handle user creation, and asking a password for it, through setup-nutyx -cu or setup-nutyx --create-user
which is caling setup-user inside the setup-nutyx bash script.
I think this is what is called by the nu (new user) alias(?).
Anyway... here is my modified setup_password function that allows empty password:
setup_password()
{
local PASSWORD CONFIRM_PASSWORD RESULT
PASSWORD=""
CONFIRM_PASSWORD=""
RESULT="false"
while [ "$RESULT" == "false" ];
do
exec 3>&1
PASSWORD=`dialog --title " $(gettext "Password") " \
--insecure "$@" \
--passwordbox " $(gettext "Enter a new password"):" 8 60 2>&1 1>&3`
CONFIRM_PASSWORD=`dialog --title " $(gettext "Password") " \
--insecure "$@" \
--passwordbox "$(gettext "Confirm the new password"):" 8 60 2>&1 1>&3`
if [ "$PASSWORD" == "$CONFIRM_PASSWORD" ]; then
RESULT="true"
else
dialog --msgbox "$(gettext "Passwords are differents, please try again")" 5 60
fi
done
if [ -z "$PASSWORD" ]; then
# empty password
passwd -d "$NAME"
else
# password is not empty
echo -e "$PASSWORD\n$CONFIRM_PASSWORD"|passwd "$NAME" 2> /dev/null
fi
$SETUP_LOG "setup-nutyx --create-user" "$NAME password changed"
}
I added the if [ -z "$password"] at the end to test for empty password. In that case, I do passwd -d username to delete (make it empty string) it.
But alone this not works because the system does not authorize empty passwords.
To authorize empty password I edited the file /etc/pam.d/system-auth as follows:
# Begin /etc/pam.d/system-auth
auth required pam_unix.so nullok
# End /etc/pam.d/system-auth
I added the nullok to allow to login with empty passwords.