Password Banner while changing the password in Linux
One of the solutions is to create a file /etc/motd_passwd_warning with your warning. Here “Your Password Minimum Requirements”.
[root@localhost ~]# cat /etc/motd_passwd_warning
Your Password Minimum Requirements
Then to change the /etc/pam.d/passwd in adding the following line :
password optional pam_echo.so file=/etc/motd_passwd_warning
[root@localhost ~]# cat /etc/pam.d/passwd
#%PAM-1.0
auth include system-auth
account include system-auth
password optional pam_echo.so file=/etc/motd_passwd_warning
password substack system-auth
-password optional pam_gnome_keyring.so use_authtok
password substack postlogin
And that is all.
Here is the result :
[root@localhost ~]# passwd
Changing password for user root.
Your Password Minimum Requirements
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully
Remember to leave a comment about this..
[root@localhost ~]# cat /etc/motd_passwd_warning
Your Password Minimum Requirements
Then to change the /etc/pam.d/passwd in adding the following line :
password optional pam_echo.so file=/etc/motd_passwd_warning
[root@localhost ~]# cat /etc/pam.d/passwd
#%PAM-1.0
auth include system-auth
account include system-auth
password optional pam_echo.so file=/etc/motd_passwd_warning
password substack system-auth
-password optional pam_gnome_keyring.so use_authtok
password substack postlogin
And that is all.
Here is the result :
[root@localhost ~]# passwd
Changing password for user root.
Your Password Minimum Requirements
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully
Remember to leave a comment about this..
Comments
Post a Comment