Linux+ 2.2.1: Users and groups
Reading the account files, a skeleton directory, a user, a group and a
service account, and the usermod -G trap.
Before you start
The lab only checks that labuser, labsvc, labgroup and
/etc/skel/bin don't exist yet; it doesn't create anything. Write answers
to the files in /root/lab-answers/. Don't run the chapter's clean-up
step: le-lab reset does it.
Tasks
- Find the lowest UID that
useraddgives a normal user on this system, and write it to/root/lab-answers/1. - Add a directory
binto/etc/skel. Then create userlabuserwith the commentLab User, shell/bin/bashand a home directory (which should get thebindirectory); a grouplabgroupwithlabuseras a member; and a system accountlabsvcwith no home directory that can't log in. - Add
labuserto the administrators' group (wheelon RHEL relatives,sudoon Debian and Ubuntu), then runusermod -G labgroup labuserand see what happens to that membership. Finish withlabuserin both groups.
Hints
/etc/login.defs:UID_MIN,SYS_UID_MAX.useradd -m -c -s,groupadd,usermod -aG,useradd -r -M -s /sbin/nologin;id,getent passwd.-Gwithout-areplaces the list of supplementary groups.