This discussion is archived
3 Replies Latest reply: Sep 26, 2012 4:49 AM by Ani RSS

command #user can change there own password (inside script..without passwd)

Ani Newbie
Currently Being Moderated
HI,
I have prepared one script, from which user can change there own password across all the nodes he wants.But problem is script is not working because the following command is not working
echo -e "$oldPassword\n$newPassword" | passwd

i have tried to run it manually but it is showing the folowing error....

[testuser@xxxxxx01 ~]$ echo -e test\ntest123|passwd
Changing password for user testuser.
Changing password for testuser
(current) UNIX password: passwd: Authentication token manipulation error
[testuser@xxxxxxx01 ~]$

any idea how to resolve this , or is there any other command where user can change their own password (inside a script).

Regards,
Ani

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points