LFCS 5.1: User and group accounts
Creating users and groups, password ageing, locking accounts, sudo rules, and cleaning up after a removed user.
Before you start
The lab creates group webadmins with member wendy, and user dave, who
owns a few files outside his home directory. Lab users' password is
Lab-Pass-1.
Tasks
- Create user
carolwith UID 2001, shell/bin/sh, a home directory, supplementary groupdevelopers(GID 3000), and an initial password that must be changed at first login. - Make every password of
carolexpire after 60 days, with a 10-day warning. - Lock
carol's password, then set the account to expire on 2026-12-31. - Let members of group
webadminsrestart and reload nginx with sudo (systemctl restart nginxandsystemctl reload nginx), and nothing else. You don't need nginx installed for this. - Remove user
daveand his home directory. Then find the files left on the system that belonged to him, and write their full paths, one per line, to/root/lab-answers/5.
Hints
useradd -u ... -s ... -m -G ...,groupadd -g,chage -d 0.chage -M -W,passwd -lorusermod -L,chage -E.- A file in
/etc/sudoers.d/checked withvisudo -cf;sudo -l -U wendy. userdel -r, thenfind / -xdev -nouser.