I have build a Linux From Scratch live CD and wrote an installer script for it. There is a step in that script in which I take an username and password from the user and create an user. The installed filesystem is mounted at
/mnt The username is stored in
$USER and password in
To create the user, I use
chroot /mnt useradd $USER -s /bin/bash -m
To change the password, I use
chroot /mnt echo "$USER:$PASS"|chpasswd
But when I boot into the installed filesystem, I notice that the user has been created, but no password has been assigned. Where am I doing wrong?