Farooq,
If you're unable to login as root, here's a link that will walk you thru recreating the /etc/passwd file:
http://docs.sun.com/app/docs/doc/817-1985/6mhm8o5r3?a=view
If you're unable to login as a user, it's real simple, as root from a terminal, type:
passwd <username>
it'll prompt you for a new password.
Hope that helps you out,
Dave S.