この投稿では、root を含むすべてのユーザーのパスワードの複雑さを構成する手順の概要を説明します。 「pam_cracklib.so デフォルトでは、PAM モジュールは「root」ユーザーのパスワードの複雑さをチェックしません。それを克服するために、「pam_passwdqc.so 」モジュールを使用して、「root」を含むすべてのユーザーに制限を適用できます。
1. 「pam_passwdqc.so」は「pam_passwdqc」パッケージで提供されます。
# rpm -qf /lib64/security/pam_passwdqc.so pam_passwdqc-1.0.5-8.el6.x86_64
2. /etc/pam.d/system-auth ファイルの「pam_cracklib.so」モジュール行をコメントアウトし、「pam_passwdqc.so」を追加します。行の順序が重要であることを忘れないでください!
# password requisite pam_cracklib.so try_first_pass retry=3 type= ### Comment out this line password requisite pam_passwdqc.so enforce=everyone ### Apply password restriction to all users
3. root ユーザーのパスワードのリセットをテストします。
# passwd Changing password for user root. You can now choose the new password or passphrase. A valid password should be a mix of upper and lower case letters, digits, and other characters. You can use an 8 character long password with characters from at least 3 of these 4 classes, or a 7 character long password containing characters from all the classes. An upper case letter that begins the password and a digit that ends it do not count towards the number of character classes used, unless disable_firstupper_lastdigit_check option is enabled. A passphrase should be of at least 3 words, 11 to 40 characters long, and contain enough different characters. Alternatively, if noone else can see your terminal now, you can pick this as your password: "ambush!nail_buy". Enter new password:
4. 詳細とパスワードの複雑さの調整については、「PAM_PASSWDQC」man ページを参照してください。
# man PAM_PASSWDQC注意 :– pam_cracklib.so &pam_passwdqc.so モジュールは同様のパスワード チェック機能を提供するため、両方を同時に使用しないでください。