← Back To Writings

  • January 22, 2021 (Updated January 25, 2021)
  • @nick

How to make a short password in macOS

By default, macOS decides to be stupid (as usual) and restrict user passwords to have a minimum length of 4. This makes a lot of great sense, because you can also choose to not have a password at all. /s Anyway, let's say you want a 2 character password. To do that, you need to change the global password policy file that is stored on your macOS. Here's how you do that:

  1. pwpolicy getaccountpolicies > ~/Desktop/file.plist
  2. Open up file.plist in a text editor and remove the first line to make it into a valid XML file.
  3. Change the bolded part to the desired regular expression to use for password validation: policyAttributePassword matches '^$|.{4,}+'.
  4. This is the regular expression I use for mine: ^$|.{1,}+. So basically I change the 4 to a 1 to make the minimum password length required to be 1 character.
  5. pwpolicy setaccountpolicies ~/Desktop/file.plist.
  6. Now you can change your password to whatever you want using passwd.