change linux user password with script

Shell
# echo "thanu:new_password" | chpasswd

Source

Also in Shell: