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)? \
  • 1
    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, 2013 at 12:25

3 Answers 3


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.


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

  • There is a lot of values (that I use) bot no configuration for the max length.
    – Pilou
    Jan 4, 2013 at 14:03

Adding to the second answer; apart from editing the /etc/security/user file manually you can also issue the following command:

chsec -f /etc/security/user -s default -a minlen=12

which sets minlen attribute of default stanza in /etc/security/user file to 12.

Note that all flags must be specified and the full path to the file provided.

default stanza is shown in the following form within the file


The colon is the delimiter and indicator of beginning of a stanza.

Indentation is optional.

View attributes with:

lssec -f /etc/security/user -s default -a minlen

Repeat -a switch for multiple attributes as -a minalpha -a minlen.

Command syntax and nomenclature is simple if you would feel :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .