Question & Answer
How do I make AIX SHA-256 and SHA-512 passwords compatible with those that are generated by other Linux/Unix OS's?
Users who want AIX to be able to recognize passwords that have been hashed on another Linux/Unix OS; for example, AIX systems who have another OS as an NIS server.
Provide instructions to configure AIX to have passwords compatible with other OS's.
AIX hashes passwords in the following manner (using SHA-256 as an example) -
This breaks down into:
This identifier is going to be a stanza that is defined in /etc/security/pwdalg.cfg; for example:
ssha256: lpa_module = /usr/lib/security/ssha lpa_options = algorithm=sha256
The next part is the 'cost'. This defaults to 6 and is ended by a dollar sign:
This value can be set between 4 and 31 in pwdalg.cfg, and causes 2^cost hashing iterations to be performed when hashing the password.
The next part is the salt, which defaults to a length of 16 for SHA-256 and is ended by a dollar sign:
The salt length can also be modified in pwdalg.cfg.
Finally, we have the hashed portion of the password:
Comparing this to another Unix OS or Linux hashed password, we would see something like:
This breaks down into the identifier:
The hashed portion:
Visible differences with this style are:
1) The identifier is numeric and enclosed in dollar signs rather than curly brackets
2) It does not contain a section for cost
The name of the identifier and use of dollar signs around the identifier can be easily configured in pwdalg.cfg: you can use any identifier you like, such as '5', by creating a stanza with that identifier. You may also specify that the identifier be enclosed in dollar signs by using the lpa_option 'prefix_dollar'.
However, the more fundamental problem in the difference between AIX and other OS's password representation is that the actual hashing algorithm is different. If AIX does not know the proper algorithm to use, it will never be able to compare a user's plaintext password with the hash that is stored.
There is a solution, though. A note regarding using Linux-style password hashing is located here:
"Linux SHA-256 and SHA-512 password cryptographic algorithm
A Loadable Password Algorithm (LPA) model is available that supports the Linux SHA-256 and SHA-512 password cryptographic algorithm. The Linux SHA-256 and SHA-512 password cryptographic algorithm is supported by other operating systems and was published in the public domain by Ulrich Drepper (https://www.akkadia.org/drepper/SHA-crypt.txt).
The LPA model is included in the pwmod Licensed Program Product (LPP) package. You can get the pwmod package from the AIX Web Download Pack website."
At the Web Download Pack site, you can find the AIX Loadable Password Algorithm (LPA):
Choose to download this, and it will download a package called 'pwmod'. This package can be installed with 'smitty install'.
This puts the /usr/lib/security/lsha and lsha_64 modules in place on your system.
Modify your pwdalg.cfg to have a stanza called '5':
5: lpa_module = /usr/lib/security/lsha lpa_options = algorithm=sha256,prefix_dollar
Your system will now be able to recognize SHA-256 passwords generated using the Linux-style hashing method.
For Linux-style SHA-512, add a stanza called '6':
6: lpa_module = /usr/lib/security/lsha lpa_options = algorithm=sha512,prefix_dollar
At this point, AIX will now be able to understand passwords hashed using the Linux-style SHA-256 or SHA-512 ('5' or '6') methods.
If you would like your system to use one of these methods by default, change the pwd_algorithm value in login.cfg to specify which one you want:
chsec -f /etc/security/login.cfg -s usw -a pwd_algorithm=5
This is not a necessary step; it is only needed if you want AIX to to use this hashing method for all newly-generated passwords. Existing passwords will still be usable with their old hashing method, but will not be converted to the new method until they have been changed.
One of the important things for this to be able to work with AIX is that AIX's password hashing routine needs to have support for the 'prefix_dollar' option, in order to provide the same type of prefix that Linux expects.
The support for this is fairly new to AIX - it was introduced in bos.rte.libc versions:
126.96.36.199 (7.2tl1 base level)
Those service packs, and everything higher (including 7.1tl5, 7.2tl2, 7.2tl3, and everything going forward) will be the only levels of AIX that this pwmod package will successfully work with.
If additional assistance is required after completing all of the instructions provided in this document, please follow the step-by-step instructions below to contact IBM to open a service request (PMR) for software under warranty or with an active and valid support contract. The technical support specialist assigned to your support call will confirm that you have completed these steps.
a. Document and/or take screen shots of all symptoms, errors, and/or messages that might have occurred
b. Capture any logs or data relevant to the situation
c. Contact IBM to open a support call (PMR):
- For electronic support, please visit the web page:
- For telephone support, please visit the web page:
- Please visit the IBM Support Portal web page for additional resources:
d. Provide a good description of your issue and reference this technote
e. Upload all of the details and data to your support call (PMR):
Please visit this web page for instructions: https://www.secure.ecurep.ibm.com/app/upload
Quality documentation is important to IBM and its customers. If you have feedback specific to this article, please send an detailed message to the email address:
- - This email address is monitored for feedback purposes only.
- No support for any IBM products or services will be provided through this email.
- To receive support, please follow the step-by-step instructions in the above "SUPPORT" section.
Was this topic helpful?
01 March 2022