O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

chkpasswd

Synopsis

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

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.

Options

-c

Compare user input with the password hash directly, rather than running it through the crypt algorithm first.

-i

Specify the directory service to use, which may be file, netinfo, nis, or opendirectory.

-l

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).

username

Designate whose password is checked. It defaults to that of the user running the command.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required