chkpasswd [-c] [-i
Useful for scripts, this prompts for a password which is then compared against the appropriate directory service for the user specified. If the password is correct, chkpasswd returns 0; otherwise, it returns 1, and the string "Sorry" is printed to standard error.
Compare user input with the password hash directly, rather than running it through the crypt algorithm first.
Specify the directory service to use, which may be file, netinfo, nis, or opendirectory.
Depending on the directory service being used, it's either a file (defaults to /etc/master.passwd), a NetInfo domain or server/tag combo, a NIS domain, or an Open Directory node (like /NetInfo/root).
Designate whose password is checked. It defaults to that of the user running the command.