How to Set a Short User Password in macOS Mojave and Later (10.14+)
I just installed macOS Mojave and put in my usual short desktop-only password I've been using for years (yes, you read that right). Now though, the operating system rejects setting a password less than 4 characters. It also does not allow having no password at all.
I am completely comfortable using the shell if need be.
How can I change the password policy to allow quite short passwords?
Optionally, learn a bit of the regular expression language - regex (this may take a while) and you can use the one crafted below for a 4 character length password. Here’s how to retrieve the configuration, edit that file, and then load it into the system:
-
pwpolicy getaccountpolicies | awk 'NR>1' > ~/Desktop/file.plist
-
nano ~/Desktop/file.plist
-
Change the quoted part to your Regex.
policyAttributePassword matches '^$|.{4,}+'
-
pwpolicy setaccountpolicies ~/Desktop/file.plist
-
passwd
Presets:
-
^$|.{1,}+
: Any password. (Not the best Regex, but I didn't want to mess around with it too much.)
Confirmed this works with macOS Mojave (10.14).
Source: Modify pwpolicy in Sierra
You can also use the much more straightforward command:
pwpolicy -clearaccountpolicies
to remove the 4-character requirement for all users. The man
page gives other useful examples if you want to change the policy on a per-user basis.