Unable to set root password with clear text using preseed/early_command
Hi,
I want to set the root password to a random string. this is the preseed I use:
d-i preseed/early_command string \
pw="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 24)"; \
debconf-set passwd/root-password "$pw"; \
debconf-set passwd/root-password-again "$pw"
However, the installer still prompts me for the root password.
Setting the crypted password works though:
d-i preseed/early_command string \
debconf-set passwd/root-password-crypted '<crypted-string>'
Directly setting the password also works:
d-i passwd/root-password password r00tme
d-i passwd/root-password-again password r00tme
>From https://sources.debian.org/src/user-setup/1.88/user-setup-ask/#L36,
it seems the installer will ask for the root password if
root-password-crypted is empty or !. My guess is that in the direct
version, somehow root-password-crypted gets a corresponding value when
only root-password and root-password-again are set, but I couldn't
find the code responsible for that.
I'd be grateful if anyone could shed some light.
Reply to: