2

I don't want secure password for my desktop. Instead I use just two letters for quick typing. I can change password in terminal by running:

passwd

But terminal gives me: Failed global policy "com.apple.defaultpasswordpolicy" Password change failed because password does not meet minimum quality requirements

I believe if the password has less than 4 characters this is blocked. The same limitation is when trying to set it by preference panel obviously.

Until now in last versions of system, only solution I found was installing of Server application from Apple and basically modifying you osx by it to be a server, so you can access one setting for password characters policy and be able to set whatever password you like. So is there other option ?

bmike
  • 235,889
Renetik
  • 260
  • What are you actually running in Terminal to get that error? Might be worth adding, right now the question looks kind of incomplete? – nohillside Dec 02 '18 at 15:23

1 Answers1

11

I found this not so easy solution on web, that works quickly instead of necessity to do it by Server application from apple.

In Terminal:

pwpolicy getaccountpolicies > temp.xml
nano temp.xml

Now remove text prior to first <xml tag and replace

<string>policyAttributePassword matches '^$|.{4,}+'</string>

to

<string>policyAttributePassword matches '^$|.{1,}+'</string>

then save file (Ctrl-O), exit (Ctrl-X) and run

sudo pwpolicy setaccountpolicies temp.xml

to install the updated policy.

nohillside
  • 100,768
Renetik
  • 260
  • It's always advisable to reduce the work done in an admin/root shell to a minimum. Luckily one can read the current policies without having to be root. – nohillside Dec 02 '18 at 15:05
  • 1
    It works for me ! thanks a lot! First: remove the one line, Two: alter march rules! – Love Dec 23 '18 at 01:35
  • 1
    I am getting now after some years Error: The data is not in the correct format. so looks like it doesn't work anymore – Renetik May 23 '21 at 18:28
  • Worked for me in May 2023 on an old machine running macOS Catalina, thanks! – dylanjameswagner May 12 '23 at 03:08
  • the generated template file adds a string on top, states something like "Getting global account policies", remove it while modifying the xml file, and it'll work fine – ahhmarr Aug 04 '23 at 22:15