Run pwconv to check the passwd file for errors.
I had the same symptoms as daya. I ran pwconv, and it returned:
bash-3.00# pwconv
pwconv: ERROR: bad entry or blank line at line 9 in /etc/passwd
Turns out I had fat-fingered a manual edit to /etc/passwd. As soon as I fixed that, passwd worked. It seems that passwd breaks as soon as it comes to a corrupt entry in the passwd file.
You say that some of your users can change their password, and not others. Perhaps there is a corrupt line in your passwd file, and the users who can change their password are above that line, and the ones who can't are below?
Just a guess...
---------- Post updated at 08:55 PM ---------- Previous update was at 08:49 PM ----------
You have two users with the same home directory:
rajeevk:x:150143:1:Rajeev Kumar:/export/home3/Student2nd_year/rajeevk/:/bin/sh
rajeshk:x:150153:1:Rajesh Kumar:/export/home3/Student2nd_year/rajeevk/:/bin/sh
I'm not sure, but it would not surprise me if that made passwd angry