Author Topic: How to allows booting with empty passwords on your own ISOs  (Read 3316 times)

dufresnep

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
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:
Code: [Select]
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:
Code: [Select]
# 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.



Thierry

  • Administrator
  • Hero Member
  • *****
  • Posts: 706
  • Karma: +13/-0
  • Gender: Male
    • NuTyX distribution
Re: How to allows booting with empty passwords on your own ISOs
« Reply #1 on: Tue Dec 03 08:08:43 2019 »
Thank you very much for your efforts. Even if I'm not very active at the moment. I appreciate your reseach and Investigation.

I see now what is wrong with the install-nutyx script documentation. Will need to review completly this page.