Unit 7: User and Group Administration - Practice Quiz
1 In Linux, what is the primary purpose of a user account?
2 What is the numeric identifier assigned to each user account called?
3 What is a group in Linux primarily used for?
4 Which command is used to create a new user account in Linux?
usernew
adduname
useradd
createuser
5
Which option with useradd specifies a custom home directory for the new user?
-d
-p
-u
-h
6
Which useradd option assigns a specific UID to the new user?
-c
-u
-g
-s
7 Which command removes an existing user account from the system?
userdel
rmuser
userrm
deluser
8
Which userdel option also removes the user's home directory and mail spool?
-r
-f
-h
-d
9 Which command is used to modify an existing user account?
editusr
userchange
moduser
usermod
10
Which usermod option is used to change a user's login name?
-n
-r
-l
-c
11
Which usermod option adds a user to a supplementary group without removing existing ones?
-G only
-aG
-s
-g
12 Which command is used to create a new group?
groupadd
newgroup
creategroup
addgroup2
13
Which groupadd option specifies a particular GID for the new group?
-u
-d
-p
-g
14 Which command deletes an existing group from the system?
grouprm
rmgroup
groupdel
delgroup
15 Which command is used to modify an existing group's properties?
editgroup
groupmod
groupchange
modgroup
16
Which groupmod option changes the name of an existing group?
-r
-l
-c
-n
17 Which command is used to change a user's password?
chpass
setpass
passwd
password
18 In modern Linux systems, where are the encrypted user passwords stored?
/etc/passwd
/etc/login
/etc/shadow
/etc/group
19 Which file contains basic information about user accounts such as username, UID, and home directory?
/etc/passwd
/etc/fstab
/etc/hosts
/etc/group
20 Which file stores group definitions and lists the members belonging to each group?
/etc/gshadow
/etc/shadow
/etc/passwd
/etc/group
21
A system administrator runs useradd -m -s /bin/bash alice. What is the combined effect of the -m and -s options?
bash group and creates a mail spool
bash and skips home directory creation
/bin/bash
22
You want to delete the user bob and also remove his home directory and mail spool. Which command achieves this?
userdel -r bob
userdel bob -m
userdel -f bob
userdel --home bob
23
To add the existing user carol to the supplementary group developers without removing her from other groups, which command is correct?
usermod -aG developers carol
usermod -g developers carol
usermod -G developers carol
usermod -A developers carol
24
In /etc/passwd, an entry reads dave:x:1005:1005:Dave K:/home/dave:/bin/bash. What does the x in the second field indicate?
/etc/shadow
25
An administrator needs to create a group named finance with a specific GID of 2000. Which command is correct?
groupadd finance -u 2000
groupadd --gid=finance 2000
groupadd -G 2000 finance
groupadd -g 2000 finance
26
The command passwd -l user1 is executed. What is the effect on user1?
/etc/passwd
27
To rename the group oldteam to newteam, which command should be used?
groupmod -g newteam oldteam
groupmod oldteam newteam
groupmod -r newteam oldteam
groupmod -n newteam oldteam
28
An attempt to run groupdel projects fails. Which of the following is the most likely reason?
projects is the primary group of an existing user
projects is below 1000
29
The command usermod -L eve is run. What does this accomplish?
eve belongs to
eve
30
A line in /etc/group reads developers:x:2001:alice,bob. What do alice and bob represent in this entry?
developers as a supplementary group
developers
31
Which command creates a system account svc with no login shell, commonly used for running services?
useradd -D -s /bin/false svc
useradd -r -s /usr/sbin/nologin svc
useradd -m -s /bin/bash svc
useradd -g root -p svc
32
You want to force user2 to change their password at next login. Which command sets this?
passwd -d user2
passwd -x user2
passwd -n user2
passwd -e user2
33
The command usermod -d /home/newdir -m frank is executed. What happens?
/home/newdir
/etc/passwd entry changes; no files move
frank is created with home /home/newdir
34
How many colon-separated fields does a standard entry in /etc/passwd contain?
35
To change the GID of the group qa to 3000, which command is correct?
groupmod -g 3000 qa
groupmod -u 3000 qa
groupmod -n 3000 qa
groupmod --gid qa 3000
36 In Linux, what is the primary difference between a user's primary group and a supplementary group?
/etc/group
37
Where does useradd read default values (like default shell and home base) from when options are not specified?
/etc/passwd and /etc/group
/etc/skel and /etc/hosts
/etc/profile and /etc/bashrc
/etc/default/useradd and /etc/login.defs
38
The chage -l user3 command is used primarily to display what information?
user3
user3
user3
user3
39 When a new user is created without specifying a group, what typically happens on a system using the user private group (UPG) scheme?
users group with all others
root group by default
40
A user account has the shell field in /etc/passwd set to /usr/sbin/nologin. What is the practical effect?
41
A line in /etc/passwd reads:
john:x:1005:1005::/home/john:/sbin/nologin
What is the practical consequence of the final field combined with the second field?
/etc/passwd and interactive login is denied
/etc/shadow and interactive login is denied
42
A user dev currently belongs to groups dev, docker, and sudo. An admin runs:
usermod -G project dev
What happens to the user's group membership?
project are kept
-a is required to change groups
docker and sudo and left only in dev and project
project is added while docker and sudo are retained
43
An admin wants to create a system account backup with no login shell, no home directory creation, and a UID below 1000. Which command is correct?
useradd -u 1500 -s /usr/sbin/nologin backup
useradd -r -s /usr/sbin/nologin -M backup
useradd -r -m -s /bin/false backup
useradd -m -s /bin/bash backup
44
A user alice is currently logged in with a running process. An admin runs userdel -r alice. What is the most likely outcome?
/etc/passwd remains until reboot
45
In /etc/shadow, a user's entry has the fields ... :18000:0:90:7:14: :. What does the value 14 (the sixth field after last-change) represent?
46
A group staff has GID 1010. An admin runs groupmod -g 1200 staff. Which statement about existing files is correct?
47
Two users, bob (UID 1002) and carol (UID 1002), both appear in /etc/passwd with the same UID. What is the security/functional implication?
48
An admin needs to create a group ops with a specific GID 600, but GID 600 is already in use. Which command creates the group while allowing the duplicate GID?
groupadd -o -g 600 ops
groupadd -f -g 600 ops
groupadd -g 600 ops
groupadd -r -g 600 ops
49
An admin runs passwd -l alice followed by passwd -S alice, which shows status L. What exactly did the lock do?
/etc/shadow
/sbin/nologin
! to the password hash, making no hash match during authentication
50
An admin wants to change user sam's home directory to /data/sam AND move the existing files. Which single command achieves both?
usermod -b /data/sam sam
usermod -d /data/sam -M sam
usermod -d /data/sam sam
usermod -m -d /data/sam sam
51
In /etc/group, the entry wheel:x:10:root,admin lists members. If user admin also has wheel as their primary group in /etc/passwd, will admin appear in the groups admin output for wheel?
wheel appears because it is both the primary group and a listed supplementary member
grpconv to synchronize the files
/etc/passwd, causing a conflict
52
Given /etc/default/useradd defines SHELL=/bin/bash and /etc/login.defs sets CREATE_HOME yes, an admin runs useradd -s /bin/zsh dan. Which shell and home behavior result?
/bin/zsh; home directory created
/bin/bash; no home directory created
/bin/zsh; no home directory created
/bin/bash; home directory created
53
An admin attempts groupdel developers, but the command fails. developers is the primary group of user eve. Why does it fail?
groupdel requires the -f flag for any non-empty group
54
An admin runs chage -M 60 -W 10 -I 5 frank. If frank's password was last changed on day 0, on which day (approximately) does the account become inactive/locked?
55
An admin runs usermod -L -e 1 grace. What is the combined effect?
56
A corrupted /etc/passwd line reads:
henry:x:1007:1007:Henry:/home/henry
What is the effect of the missing seventh field?
/bin/sh (or /bin/bash) as the default shell
57
A user needs group data's permissions for a new file they just created, but their session started before they were added to data via usermod -aG data user. Why does newgrp data help but re-login does not immediately?
newgrp starts a new shell with updated groups
newgrp rewrites /etc/group while re-login only reads /etc/passwd
newgrp grants root privileges temporarily to bypass group checks
58
An admin runs groupmod -n engineers devs. After this, what is true about files previously owned by group devs?
59
After running userdel ivan (without -r), an admin creates a new user julia who receives ivan's old UID. What risk exists regarding ivan's leftover files?
60
An admin runs useradd -u 0 -o -g 0 shadowroot. What is the outcome and its significance?
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →