Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found on the AIX documentation some rules to set about passwords length :

minlen Defines the minimum length of a password. The value is a decimal integer string. The default is a value of 0, indicates no minimum length. The maximum value allowed is PW_PASSLEN attribute. This attribute is determined by the minalpha attribute value added to the minother attribute value. If the sum of these values is greater than the minlen attribute value, the minimum length is set to the result.

Note: The PW_PASSLEN attribute is defined in /usr/include/userpw.h. The value of the PW_PASSLEN attribute is determined by the system-wide password algorithm that is defined in /etc/security/login.cfg .

The minimum length of a password is determined by the minlen attribute and should never be greater than the PW_PASSLEN attribute. If the minalpha attribute + minother attribute is greater than the PW_PASSLEN attribute, then the minother attribute is reduced to PW_PASSLEN attribute - minalpha attribute.

But, for consistency, I need to set the max length for password to 12.

I dont understand exactly how to configure the userpw.h to set this max at 12.

There is my actual PW_PASSLEN :

#define PW_PASSLEN   ((__extension_status & _EXTENSION_C2)? \
share|improve this question
I hardly understand why you need to set a maximum length to your passwords. Isn't it the point: having longer passwords to provide better security? I think this is why there is no such thing as a maximum password length. – user21228 Jan 11 '13 at 12:25
up vote 2 down vote accepted

I believe you need to modify the value for MAXIMPL_PW_PASSLEN in /usr/include/userpw.h, from 256 to 12, but I would strongly suggest you read the documentation in that file, and test this on a non-critical box. If you have access, I'd suggest verifying this with IBM support.

share|improve this answer

See the /etc/security/user file: this contains the minalpha/minother/etc values you need to change :)

share|improve this answer
There is a lot of values (that I use) bot no configuration for the max length. – Pierre-Louis Laffont Jan 4 '13 at 14:03

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.