Your password has to expire every 30 days.
The minimum number of days allowed before the modification of a password will be set to 2.
The user has to receive a warning message 7 days before their password expires.
Your password must be at least 10 characters long.
It must contain an uppercase letter and a number.
Also, it must not contain more than 3 consecutive identical characters.
The password must not include the name of the user.
The password must have at least 7 characters that are not part of the former password.
Of course, your root password has to comply with this policy
암호는 30일마다 만료되어야 합니다.
암호를 수정하기 전에 허용되는 최소 일 수는 2일로 설정됩니다.
사용자는 암호가 만료되기 7일 전에 경고 메시지를 받아야 합니다.
암호는 10자 이상이어야 합니다.
대문자 및 숫자를 포함해야 합니다.
또한 연속적으로 동일한 문자를 3자 이상 사용할 수 없습니다.
암호에는 사용자 이름을 포함할 수 없습니다.
암호는 이전 암호의 일부가 아닌 7자 이상이어야 합니다.
물론 root 암호도 이 정책을 준수해야 합니다.
암호 정책 설정 파일
sudo vi /etc/login.defs
다음과 같이 수정
PASS_MAX_DAYS 30
PASS_MIN_DATS 2
PASS_WARN_AGE 7
암호 정책 설정을 위해 추가 설치
apt-get -y install libpam-pwquality
vi /etc/pam.d/common-password
다음과 같이 수정
retry=3 뒤로 설정들을 추가적으로 붙여야함
minlen=10
ucredit=-1
lcredit=-1
dcredit=-1
maxrepeat=3
reject_username
enforce_for_root
difok=7
강제적으로 사용자의 암호를 만료시킨다
passwd -e 사용자명