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 bolded 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


@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.

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] macOS Mojave Shutdown cause

0 Answered Questions

Create User via Terminal with Bash in macOS Mojave

0 Answered Questions

How to create a custom macOS Mojave 10.14 read-only boot volume?

1 Answered Questions

[SOLVED] For Install MacOS mojave

  • 2019-01-30 20:21:55
  • Shomsar Rahman Babu
  • 135 View
  • 1 Score
  • 1 Answer
  • Tags:   macos macbook mojave

1 Answered Questions

[SOLVED] Damaged macOS Mojave installer

  • 2018-10-22 17:33:19
  • Jalal Ahmad
  • 6450 View
  • 4 Score
  • 1 Answer
  • Tags:   macos mojave

0 Answered Questions

Mojave and its non-respect of the AppleLocale preference

1 Answered Questions

[SOLVED] macOS Mojave Installation

0 Answered Questions

macOS Mojave Installation Error

1 Answered Questions

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

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

0 Answered Questions

Sponsored Content