Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Ubuntu Documentation > Ubuntu 9.04 > Ubuntu Server Guide > Security > User Management states that there is a default minimum password length for Ubuntu:

By default, Ubuntu requires a minimum password length of 4 characters

Say the password is to be modified by the user using passwd. Is there a command for displaying the current password policies for a user (such as the chage command displays the password expiration information for a specific user)?

> sudo chage -l SomeUserName
Last password change                                : May 13, 2010
Password expires                                    : never
Password inactive                                   : never
Account expires                                     : never
Minimum number of days between password change      : 0
Maximum number of days between password change      : 99999
Number of days of warning before password expires   : 7

This is rather than examining various places that control the policy and interpreting them since the process could contain errors. A command that reports the composed policy would be used to check the policy setting steps.

share|improve this question
Please provide a valid reason for migrating valid Super User questions. If a question does not receive an answer on Super User after a period of time we will be willing to migrate it, but we are not migrating valid questions without a valid reason. Also note all further flags to such effect will be ignored on the above basis. –  Diago Feb 12 '11 at 19:44
I would post the question in the Ubuntu site rather than on SU if I had known it existed. So, should I repost this question on the Ubuntu site rather than having it migrated to the most focused site? –  C.W.Holeman II Feb 28 '11 at 23:23

1 Answer 1

THe policy is found in /etc/pam.d/common-password. Default policy is obscure which is documented in the pam_unix man page. You may want to install pam_cracklib and add some addition policies. Password changes by root generally avoid policies.

If you are not using pam to verify the new password, then the policy will belong to the tool used to change the password. This can happen if you are using LDAP or another external password database and changing the password directly in the database.

share|improve this answer
Added to the question that passwd is the tool to be used. –  C.W.Holeman II Jun 9 '10 at 18:22
If that is the case, /etc/pam.d/common-passwd is where the policy gets inserted. pam_unix provides the default policy. I don't think a policy display tool exists. It would need to know all the possible pam modules that apply. Considering that these are possibly user-written, only some policies would be possible. –  BillThor Jun 12 '10 at 1:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.