Chpasswd with yescrypt

Hey,

so with the recent change to yescrypt the following command doesn’t seem to work anymore, because it doesn’t support the encryption method:

printf ‘$USER:$PASSWORD’ | chpasswd

I use this command in a script for changing user passwords. So my questions is, is there another way of doing the same thing?

Is it running as root? If so you could try something like:

printf "${PASSWORD}\n${PASSWORD}" | passwd $USER
2 Likes

Yeah, that works. Thanks!

edit:

I changed it to echo, because it sometimes didn’t work:

echo -e “${PASSWORD}\n${PASSWORD}” | passwd $USER

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.