How to force the Mac to not expire passwords?
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