By Eric Majerus

2018-09-25 00:52:44 8 Comments

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?


@JBis 2018-09-26 23:34:51

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:

  1. pwpolicy getaccountpolicies > ~/Desktop/file.plist
  2. nano ~/Desktop/file.plist
  3. Delete the first line, which says Getting global account policies to make the file valid XML.
  4. Change the quoted part to your Regex.

    policyAttributePassword matches '^$|.{4,}+'
  5. pwpolicy setaccountpolicies ~/Desktop/file.plist

  6. passwd


  • ^$|.{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

@Motsel 2019-03-27 11:37:29

This no longer works in Mojave 10.14.4 (the setaccountpolicies gives an error about wrong format.) See answer from @david-p below for a working solution.

@JBis 2019-03-27 11:41:24

@Motsel Step 3.

@Motsel 2019-03-27 16:25:32


@FeFiFoFu 2019-09-28 17:03:09

Looks like you duplicate the policy, then point system to look at the new policy file. How do you revert? (i.e., get the system to look at the default policy file).

@David P. 2018-12-18 03:14:11

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.

@Tim N. 2019-01-07 02:23:23

Worked for me, thanks! MacOS Mojave (10.14.2)

@Mike Van Rose 2019-01-25 22:16:09

David P. thank you very much! this Mojave requirement was driving me crazy! This totally works! you can even set a password blank Cheers!

@user318860 2019-01-26 22:20:24

Thank you so much! :D, I should keep that line in mind. now I can use my one letter password xD

@wonsuc 2019-08-11 21:45:35

Works perfectly.

@ZEE 2019-10-22 17:06:04

this is the solution... the others are a "fix"...

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] Damaged macOS Mojave installer

  • 2018-10-22 17:33:19
  • Jalal Ahmad
  • 15991 View
  • 5 Score
  • 2 Answer
  • Tags:   macos mojave

2 Answered Questions

[SOLVED] macOS Mojave Shutdown cause

1 Answered Questions

[SOLVED] macOS Mojave Installation

1 Answered Questions

[SOLVED] macOS Mojave (Developer Beta) - Safari User Agent change not persistent

  • 2018-06-05 05:40:10
  • Kenny124124
  • 727 View
  • 2 Score
  • 1 Answer
  • Tags:   macos beta mojave

Sponsored Content