SUSE Support

Here When You Need Us

Weak password encryption used when changing NIS user password

This document (7023131) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 11

Situation

The system administrator of a SLES 12 / SLES 15 system has set pam to use sha512 encryption with the following command:
pam-config -a --unix --unix-sha512
Which successfully resulted in changes to the /etc/pam.d/common-*  files, including this line from common-password:
password     required     pam_unix.so   use_authtok debug sha512 nis try_first_pass
For the most part, this has taken effect.  However, when NIS users change their password with the passwd command, the new password hash gets set using weaker encryption.
 
The encryption strength was checked in NIS before and after the passwd change, with:
ypcat passwd | grep <username>
It is clear in the ypcat data that before the change, a very long complex hash was present, and after the change, a rather short hash was present.  (Note:  In this NIS database, shadow data has been merged into passwd data.)

Resolution

For SLES 12 / SLES 15 :
 
The pam_unix module (used by default on SLES 12 / SLES 15 systems) which controls the password setting also references the /etc/login.defs file for additional setting on which encryption to use. 

Find and set these settings to sha512 (or whatever encryption is desired):
ENCRYPT_METHOD SHA512
ENCRYPT_METHOD_NIS SHA512
For more information, also see "man pam_unix" as well as comments within /etc/login.defs.
 
 
For SLES 11:
 
The pam_unix2 module (used by default on SLES 11 systems) which controls the password setting also references the /etc/default/passwd file for additional setting on which encryption to use. 
Find and set these settings to sha512 (or whatever encryption is desired):
CRYPT=sha512
CRYPT_FILES=sha512
CRYPT_YP=sha512
For more information, also see "man pam_unix2" as well as comments within /etc/defaults/passwd.

Cause

The pam_unix module (used by default on SLES 12 / SLES 15 systems) which controls the password setting also references the /etc/login.defs file for additional setting on which encryption to use. 

Additional Information

The pam_unix module (used by default on SLES 12 / SLES 15 systems) which controls the password setting also references the /etc/login.defs file for additional setting on which encryption to use. 

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7023131
  • Creation Date: 27-Jun-2018
  • Modified Date:03-Nov-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.