Configure password complexity requirements that PAM enforces when passwords are changed.
Outcomes
Review and adjust password quality requirements by configuring the /etc/security/pwquality.conf file.
As the student user on the workstation machine, use the lab command to prepare your environment for this exercise, and to ensure that all required resources are available.
[student@workstation ~]$ lab start pam-configuring
Instructions
Set the password policy on the serverc machine to require a password of at least 12 characters that include at least one symbol and one digit.
Log in to the serverc machine as the student user.
No password is required.
[student@workstation ~]$ ssh student@serverc
[student@serverc ~]$Use the sudo -i command to change to the root user.
Use the student sudo password.
[student@serverc ~]$sudo -i[sudo] password for student:student[root@serverc ~]#
Use a text editor to modify the /etc/security/pwquality.conf file to require a minimum password length of 12 characters, a minimum of one digit, and a minimum of one special character.
Read through the options in the file to know what each line modifies.
Uncomment and modify the lines to match the following output:
minlen =12dcredit =-1ocredit =-1
Verify that you meet the new requirements by setting the student user password to each of the following values:
alpha42numeric should not work (2 digits, 14 characters, but no symbol)
symbol+1digit should work (1 symbol, 1 digit, and 13 characters)
Log out of the root account.
[root@serverc ~]# logout
[student@serverc ~]$Use the passwd command to set the password for the student user.
[student@serverc ~]$passwdChanging password for user student. Current password:studentNew password:alpha42numericBAD PASSWORD: The password contains less than 1 non-alphanumeric characters passwd: Authentication token manipulation error [student@serverc ~]$passwdChanging password for user student. Current password:studentNew password:symbol+1digitRetype new password:symbol+1digitpasswd: all authentication tokens updated successfully. [student@serverc ~]$
Use the sudo -i command to become the root user again, and change back the password for the student user to student.
If the sudo command prompts for a password, then use the new one.
[student@serverc ~]$sudo -i[sudo] password for student:symbol+1digit[root@serverc ~]#passwd studentChanging password for user student. New password:studentBAD PASSWORD: The password contains less than 1 digits Retype new password:studentpasswd: all authentication tokens updated successfully. [root@serverc ~]#
Return to the workstation machine.
[root@serverc ~]#logout[student@serverc ~]$logout[student@workstation ~]$