Tyler
Tyler

Reputation: 1603

How do I determine if a user has a password set on Mac?

I need to determine if a user has a non-empty password set on Mac. Anything will work: a command line call, AppleScript, Carbon, Cocoa, etc.

I want to inform the user whether or not they have a password set.

Upvotes: 5

Views: 1455

Answers (2)

Tyler
Tyler

Reputation: 1603

I've found the answer to my question. Thanks anyway.

dscl . -authonly <username> ""

Upvotes: 9

Philip Regan
Philip Regan

Reputation: 5055

If you are performing an action that would require any user to enter a password, then you should allow them the opportunity to verify that password even if it is empty, and then handle the behavior if they decide not to allow that action accordingly.

Upvotes: 0

Related Questions