grml / grml-debootstrap

wrapper around debootstrap
61 stars 27 forks source link

chpasswd using different format in shadow than passwd #145

Open mika opened 5 years ago

mika commented 5 years ago

Quoting from IRC:

The root password for grml-debootstrap is added with $1$ to /etc/shadow (MD5?), and not $6$ (SHA256?) what passwd does.

Needs investigation whether we can do something about it.

fransvanberckel commented 4 years ago

A walk around ...

CHPASSWD_OPTION=
if chpasswd --help 2>&1 | grep -q -- '-m,' ; then
   CHPASSWD_OPTION='--md5'
fi
if chpasswd --help 2>&1 | grep -q -- '-e,' ; then
   CHPASSWD_OPTION='--encrypted'
fi