1.7 KiB
1.7 KiB
LPIC-1 107.1: User and group accounts
Creating users and groups, supplementary groups, password ageing, system accounts, and what deleting a user leaves behind.
Before you start
The lab creates group testers and users pat, ken and lou. Their
password is Lab-Pass-1. ken owns a file outside his home directory.
Tasks
- Create group
developers, and userdanawith a home directory, the commentDana Lee, the shell/bin/shand the supplementary groupdevelopers. Read the new lines in/etc/passwd,/etc/shadowand/etc/group, and the new home directory. - Add
danato a second group,testers, withusermod -aG. Then runusermod -G developers dana, and write the name of the group she lost to/root/lab-answers/2. - Make
dana's password expire every 30 days, with a 7-day warning. Check withchage -land the fields in/etc/shadow. - Force
patto change her password withchage -d 0, then log in aspat(on the console, or withssh pat@localhost) and see what happens. - Create a system account
appsvcwith anologinshell, and trysu - appsvc. - Delete user
kenwithuserdel -rand userlouwithout it. Then find the files they left behind withfind / -xdev -nouser, and write those paths to/root/lab-answers/6, one per line.
Hints
groupadd,useradd -m -c -s -G,getent passwd dana,ls -la.id danabefore and after;-ais what keeps the other groups.chage -M -W,chage -l dana; fields 5 and 6 of/etc/shadow.chage -l patshows "password must be changed".useradd -r -s(the path ofnologinis in/etc/shells, or trycommand -v nologin).userdelwith and without-r;find / -xdev -nouser 2>/dev/null.