How to enforce password complexity on Linux

Enforcing password complexity involves making decisions about how long passwords need to be and whether they must contain a mix of characters — such as digits, a mix of uppercase and lowercase, or special characters. In general, the rules are not hard to set up, but you need to know both the syntax and the rules to get the outcome you expect.