Name

chkpasswd

Synopsis

chkpasswd [-c] [-i infosystem] [-l location] [username]

Useful for scripts, this prompts for a password that is then compared against the appropriate directory service for the user specified. If the password is incorrect, the string Sorry is output. (Strangely, chkpasswd appears to have a return value of 0 in either case.)

Options

-c

User input is compared with the password hash directly, rather than running it through the crypt algorithm first.

-i

Specifies the directory service to use, and may be file, netinfo (the default), or nis.

-l

Depending on the directory service being used, it’s either a filename (defaults to /etc/master.passwd), a NetInfo domain name or server/tag combo, or an NIS domain name.

username

Designates whose password will be checked. It defaults to that of the user running the command.

Get Mac OS X in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.