1.3 KiB
1.3 KiB
Linux+ 3.4.1: Hardening accounts
Password aging, password quality, locking and expiring an account, and auditing the accounts of a system.
Before you start
User hardtest doesn't exist yet: you create it. The lab has also added
two accounts that an audit should catch. Write answers to the files in
/root/lab-answers/.
Tasks
- Read the current rules in
pwquality.conf,login.defsandfaillock.conf. Create userhardtest, and set its password aging: at most 90 days, at least 1 day, a warning 7 days before. Then make it change its password at the next login. - Ubuntu: install
libpam-pwquality, so thatpasswdjudges new passwords. Trypasswd hardtestwith the passwordpassword1(Ctrl+C to stop). On the RHEL family,passwduses pwquality already: just try it. - Lock
hardtest's password and expire the account, and look at its shadow entry andchage -l. - Audit the system: find the accounts other than root with UID 0, and the
accounts with an empty password. Write their names, one per line, to
/root/lab-answers/4.
Hints
useradd -m,chage -M -m -W,chage -d 0,chage -l./etc/pam.d/common-password.passwd -l,chage -E 0,grep hardtest /etc/shadow.awk -F: '$3 == 0' /etc/passwd,awk -F: '$2 == ""' /etc/shadow,lastlog -b 30.