今天遇到同事遇到了一個有趣的問題,就是linux系統的用戶在修改密碼的時候不能設置與歷史密碼一樣的密碼。
想修改用戶密碼。但是還不能改成和原來有相同的密碼,那這個誰能記住密碼呀!!!
於是查了一下資料,下面將講述如何解決這個問題(禁設重複密碼)
問題描述:
centos7系統 先來看看出現的問題提示。The password is the same as the old one
[test11@node1 ~]$ passwd
Changing password for user test11.
Changing password for test11.
(current) UNIX password:
New password:
BAD PASSWORD: The password is the same as the old one
問題原因:
涉及文件:
/etc/pam.d/system-auth
remember=5表示會記錄5次密碼, 所以你修改的密碼不能與原來5次的一樣。如果想解決這個問題刪除這個就行。
刪除以後測試,又能使用以前的密碼修改了。不過root用戶好像不受約束。
[test11@node1 ~]$ passwd
Changing password for user test11.
Changing password for test11.
(current) UNIX password:
New password:
Retype new password:
passwd: all authentication tokens updated successfully.