A new compliance rule says no user may reuse their last five passwords and passwords need 14+ characters. How do you enforce it?
IntermediateScenarioUsers, groups and access control
Answer
Situation read → PAM password quality and history.
What I'd do →
- In
/etc/security/pwquality.conf:minlen = 14,minclass = 3,dictcheck = 1. - For history, use
pam_pwhistory. On RHEL 9 use authselect:authselect enable-feature with-pwhistoryand setremember = 5in/etc/security/pwhistory.conf. - On Debian/Ubuntu add to
/etc/pam.d/common-password:password required pam_pwhistory.so remember=5 use_authtokbeforepam_unix. - Test with
passwdas a normal user.
Why → pwquality checks strength at change time; pwhistory stores previous hashes in /etc/security/opasswd.
Interview tip → On RHEL, editing /etc/pam.d/system-auth directly gets overwritten by authselect.
More on Users, groups and access control
You need to onboard 50 new developers onto a shared build server, each with their own account and SSH key. How do you do it?BeginnerThree teams share one server and each needs a project directory only its members can write to, with new files staying group-owned. How do you set it up?BeginnerA junior engineer needs to restart nginx but must not get full root. How do you grant that?BeginnerAn engineer leaves the company today. What do you do with their Linux account on 30 servers?BeginnerA service account for a backup tool must exist on every server but nobody should be able to log in as it. How do you create it?BeginnerYour security team requires passwords to expire every 90 days for human users only. How do you implement it?Beginner