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.
View saved passwords and passkeys in System SettingsChoose Apple menu > System Settings. In macOS Monterey, choose Apple menu > System Preferences. Click Passwords.
Click on System Privileges on your dock, or click on the Apple menu and choose System Preferences from the dropdown list. Find and click on the Users & Groups icon. Find your current username from the list on the left. If the word Admin is under your username, it's an Administrator account.
On your Mac, choose Apple menu > System Preferences, then click Users & Groups . Click Change Password. Enter your existing password in the “Old password” field, enter and verify a new password, then enter a password hint. To use the Password Assistant, click the key next to the New Password field.
An administrator account password is also the login password. An administrator can create additional administrator accounts and standard accounts. that can be entered to login but without any special privileges like creating a new account. OS X has three basic types of accounts - admin, user (non-admin) and guest.
I've found the answer to my question. Thanks anyway.
dscl . -authonly <username> ""
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With