SyntaxFix
Write A Post
Hire A Developer
Questions
You can try :
echo -e "newpasswd123\nnnewpasswd123" | passwd user