How to set a Password Policy for Apple OS X or macOS

An administrator can define a local password policy, such as requiring a minimum number of characters in Apple OS X.
If you manage multiple Apple devices, consider contacting ITS about desktop management for Apple devices. See

The current password policy for UNC-CH can be found at:

See the references at the bottom for a few good examples on how to set this policy on a device.

Below is a sample XML policy to require passwords be at least 8 characters in length.


         <string>policyAttributePassword matches '.{8,}+'</string>

To set the requirement, navigate to Utilities and open the Terminal app as an administrator .
Run the command:

pwpolicy -setaccountpolicies [filename]

where [filename] is minchars.plist in this example

Example on Configuring a Password Policy
Manual page for pwpolicy