How to force the Mac to not expire passwords? This morning, when I logged into my Mac, it forced me to change my password. Because I'm unlikely to remember a new password, I had to choose an insecure password that will be easier to remember.

It also won't let me change the password back.

I went to the Security &amp; Privacy settings and found NOTHING that can control this behavior.

Everything on the Internet that is even remotely related is about Active Directory, but I'm sure this thing isn't using Active Directory.

How do you make a Mac NOT do this?
The feature is controlled by a tool called pwpolicy. Running pwpolicy -getaccountpolicies outputs an XML document. One of the things found in this XML is this:

&lt;key&gt;policyCategoryPasswordChange&lt;/key&gt;
&lt;array&gt;
        &lt;dict&gt;
                &lt;key&gt;policyContent&lt;/key&gt;
                &lt;string&gt;policyAttributeCurrentTime &amp;gt; policyAttributeLastPasswordChangeTime + (policyAttributeExpiresEveryNDays * 24 * 60 * 60)&lt;/string&gt;
                &lt;key&gt;policyIdentifier&lt;/key&gt;
                &lt;string&gt;ProfilePayload:deadbeef-b187-1337-1ee7-abcdef123456:maxPINAgeInDays&lt;/string&gt;
                &lt;key&gt;policyParameters&lt;/key&gt;
                &lt;dict&gt;
                        &lt;key&gt;policyAttributeExpiresEveryNDays&lt;/key&gt;
                        &lt;integer&gt;90&lt;/integer&gt;
                &lt;/dict&gt;
        &lt;/dict&gt;
&lt;/array&gt;


Delete that from the XML document and then consume the altered document using:

pwpolicy -setaccountpolicies &lt;file.xml&gt;


and the problem should go away. But there is a pitfall. If you dump the XML using the shell's &gt; operator, edit the file, and pass it back to pwpolicy, you'll get this error:

Error: The data is not in the correct format.


The reason for this error is that pwpolicy -getaccountpolicies prints the following before printing the XML:

Getting global account policies