在RedHat 6.x系統下配置普通用戶密碼複雜度。
將/etc/pam.d/system-auth中的password相關文件註釋掉,見下圖中的紅色框體。
針對pam.d下的system-auth配置文件做更改後,需要重啟OS。針對密碼的策略就會生效。重啟系統後測試更改普通用戶密碼。
[root@node1 ~]# useradd test1
[root@node1 ~]# passwd test1 #針對test1配置密碼
Changing password for user test1.
New password:
BAD PASSWORD: it is WAY too short #密碼長度太短
BAD PASSWORD: is too simple #密碼太簡單
Retype new password:
passwd: all authentication tokens updated successfully.
[root@node1 ~]# passwd test1
Changing password for user test1.
New password:
BAD PASSWORD: it is too simplistic/systematic
BAD PASSWORD: is too simple #密碼太簡單
Retype new password:
Sorry, passwords do not match. #密碼不匹配
New password:
BAD PASSWORD: it is too simplistic/systematic
Retype new password:
passwd: all authentication tokens updated successfully.
在root用戶登錄的環境下,即使普通用戶密碼的複雜度不滿足要求,依舊會配置密碼成功;但如果普通用戶登錄系統,密碼複雜度策略就會生效,配置不達標的密碼就會提示失敗。
閱讀更多 挨踢人 的文章