Unit 7: User and Group Administration - Practice Quiz

CSE105 — Creative Engineering Workshop 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 In Linux, what is the primary purpose of a user account?

User Accounts and Groups Easy
A. To store application binaries
B. To manage network routing tables
C. To identify and authenticate a person using the system
D. To schedule automated backups

2 What is the numeric identifier assigned to each user account called?

User Accounts and Groups Easy
A. GID (Group ID)
B. SID (Session ID)
C. UID (User ID)
D. PID (Process ID)

3 What is a group in Linux primarily used for?

User Accounts and Groups Easy
A. Grouping users to share common permissions
B. Compressing multiple files together
C. Merging network interfaces
D. Combining several processes into one

4 Which command is used to create a new user account in Linux?

useradd Easy
A. usernew
B. adduname
C. useradd
D. createuser

5 Which option with useradd specifies a custom home directory for the new user?

useradd Easy
A. -d
B. -p
C. -u
D. -h

6 Which useradd option assigns a specific UID to the new user?

useradd Easy
A. -c
B. -u
C. -g
D. -s

7 Which command removes an existing user account from the system?

userdel Easy
A. userdel
B. rmuser
C. userrm
D. deluser

8 Which userdel option also removes the user's home directory and mail spool?

userdel Easy
A. -r
B. -f
C. -h
D. -d

9 Which command is used to modify an existing user account?

usermod Easy
A. editusr
B. userchange
C. moduser
D. usermod

10 Which usermod option is used to change a user's login name?

usermod Easy
A. -n
B. -r
C. -l
D. -c

11 Which usermod option adds a user to a supplementary group without removing existing ones?

usermod Easy
A. -G only
B. -aG
C. -s
D. -g

12 Which command is used to create a new group?

groupadd Easy
A. groupadd
B. newgroup
C. creategroup
D. addgroup2

13 Which groupadd option specifies a particular GID for the new group?

groupadd Easy
A. -u
B. -d
C. -p
D. -g

14 Which command deletes an existing group from the system?

groupdel Easy
A. grouprm
B. rmgroup
C. groupdel
D. delgroup

15 Which command is used to modify an existing group's properties?

groupmod Easy
A. editgroup
B. groupmod
C. groupchange
D. modgroup

16 Which groupmod option changes the name of an existing group?

groupmod Easy
A. -r
B. -l
C. -c
D. -n

17 Which command is used to change a user's password?

Password Management Easy
A. chpass
B. setpass
C. passwd
D. password

18 In modern Linux systems, where are the encrypted user passwords stored?

Password Management Easy
A. /etc/passwd
B. /etc/login
C. /etc/shadow
D. /etc/group

19 Which file contains basic information about user accounts such as username, UID, and home directory?

Important Files: /etc/passwd and /etc/group Easy
A. /etc/passwd
B. /etc/fstab
C. /etc/hosts
D. /etc/group

20 Which file stores group definitions and lists the members belonging to each group?

Important Files: /etc/passwd and /etc/group Easy
A. /etc/gshadow
B. /etc/shadow
C. /etc/passwd
D. /etc/group

21 A system administrator runs useradd -m -s /bin/bash alice. What is the combined effect of the -m and -s options?

useradd Medium
A. Adds the user to the bash group and creates a mail spool
B. Modifies an existing user and disables the login shell
C. Sets the password to bash and skips home directory creation
D. Creates the home directory and sets the login shell to /bin/bash

22 You want to delete the user bob and also remove his home directory and mail spool. Which command achieves this?

userdel Medium
A. userdel -r bob
B. userdel bob -m
C. userdel -f bob
D. 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 Medium
A. usermod -aG developers carol
B. usermod -g developers carol
C. usermod -G developers carol
D. 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?

Important Files: /etc/passwd and /etc/group Medium
A. The encrypted password is stored in /etc/shadow
B. The password field is corrupted
C. The account has no password set
D. The user cannot log in interactively

25 An administrator needs to create a group named finance with a specific GID of 2000. Which command is correct?

groupadd Medium
A. groupadd finance -u 2000
B. groupadd --gid=finance 2000
C. groupadd -G 2000 finance
D. groupadd -g 2000 finance

26 The command passwd -l user1 is executed. What is the effect on user1?

Password Management Medium
A. The user is forced to change the password at next login
B. The password is permanently deleted from the system
C. The account's password is locked, preventing password-based login
D. The account is completely removed from /etc/passwd

27 To rename the group oldteam to newteam, which command should be used?

groupmod Medium
A. groupmod -g newteam oldteam
B. groupmod oldteam newteam
C. groupmod -r newteam oldteam
D. groupmod -n newteam oldteam

28 An attempt to run groupdel projects fails. Which of the following is the most likely reason?

groupdel Medium
A. projects is the primary group of an existing user
B. The group name contains only lowercase letters
C. The GID of projects is below 1000
D. The group has no members assigned to it

29 The command usermod -L eve is run. What does this accomplish?

usermod Medium
A. Locks the user's password, disabling password login
B. Lists the groups that eve belongs to
C. Sets the account expiration date to today
D. Changes the login name of eve

30 A line in /etc/group reads developers:x:2001:alice,bob. What do alice and bob represent in this entry?

Important Files: /etc/passwd and /etc/group Medium
A. Users who have developers as a supplementary group
B. Administrators who can modify the group
C. Users whose home directories are shared
D. Users whose primary group is developers

31 Which command creates a system account svc with no login shell, commonly used for running services?

useradd Medium
A. useradd -D -s /bin/false svc
B. useradd -r -s /usr/sbin/nologin svc
C. useradd -m -s /bin/bash svc
D. useradd -g root -p svc

32 You want to force user2 to change their password at next login. Which command sets this?

Password Management Medium
A. passwd -d user2
B. passwd -x user2
C. passwd -n user2
D. passwd -e user2

33 The command usermod -d /home/newdir -m frank is executed. What happens?

usermod Medium
A. Frank's directory is deleted and recreated empty
B. Frank's home directory is changed and existing files are moved to /home/newdir
C. Only the /etc/passwd entry changes; no files move
D. A new user frank is created with home /home/newdir

34 How many colon-separated fields does a standard entry in /etc/passwd contain?

Important Files: /etc/passwd and /etc/group Medium
A. 7
B. 9
C. 6
D. 5

35 To change the GID of the group qa to 3000, which command is correct?

groupmod Medium
A. groupmod -g 3000 qa
B. groupmod -u 3000 qa
C. groupmod -n 3000 qa
D. groupmod --gid qa 3000

36 In Linux, what is the primary difference between a user's primary group and a supplementary group?

User Accounts and Groups Medium
A. The primary group is assigned to new files a user creates; supplementary groups grant additional access
B. The primary group cannot be changed, but supplementary groups can
C. Only the primary group appears in /etc/group
D. Supplementary groups own the user's home directory by default

37 Where does useradd read default values (like default shell and home base) from when options are not specified?

useradd Medium
A. /etc/passwd and /etc/group
B. /etc/skel and /etc/hosts
C. /etc/profile and /etc/bashrc
D. /etc/default/useradd and /etc/login.defs

38 The chage -l user3 command is used primarily to display what information?

Password Management Medium
A. Password aging and expiration details for user3
B. The supplementary groups of user3
C. The current encrypted password of user3
D. The list of files owned by 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?

User Accounts and Groups Medium
A. A new group with the same name as the user is created and set as the primary group
B. The user shares the users group with all others
C. No group is assigned until manually configured
D. The user is added to the 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?

Important Files: /etc/passwd and /etc/group Medium
A. The user cannot obtain an interactive login shell
B. The user has full administrative privileges
C. The user is automatically added to all groups
D. The user's password never expires

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?

Important Files: /etc/passwd and /etc/group Hard
A. The user's real password is stored in /etc/passwd and interactive login is denied
B. Authentication is delegated to /etc/shadow and interactive login is denied
C. The user has no password set and can log in without authentication
D. The account is locked and cannot be referenced by any process

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?

usermod Hard
A. All existing secondary groups plus project are kept
B. The command fails because -a is required to change groups
C. The user is removed from docker and sudo and left only in dev and project
D. 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 Hard
A. useradd -u 1500 -s /usr/sbin/nologin backup
B. useradd -r -s /usr/sbin/nologin -M backup
C. useradd -r -m -s /bin/false backup
D. 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?

userdel Hard
A. The command fails outright and no changes are made
B. The command completes and silently kills all of alice's processes
C. The account is disabled but the entry in /etc/passwd remains until reboot
D. userdel warns that the user is currently logged in but still removes the account entry and home directory

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?

Password Management Hard
A. The number of days before the password expires that a warning appears
B. The number of days after expiration before the account is disabled
C. The maximum number of days the password is valid
D. The minimum number of days before the password can be changed

46 A group staff has GID 1010. An admin runs groupmod -g 1200 staff. Which statement about existing files is correct?

groupmod Hard
A. Files owned by GID 1010 now show an orphaned numeric GID and must be manually re-owned
B. File ownership is preserved because ownership tracks group name, not GID
C. All files owned by GID 1010 are automatically re-tagged to GID 1200
D. The command fails because files still reference the old GID

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?

User Accounts and Groups Hard
A. The system automatically increments carol's UID at next boot
B. Both accounts are treated by the kernel as the same identity with identical file permissions
C. The second entry is ignored and carol cannot log in
D. Login is blocked for both users due to the UID conflict

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 Hard
A. groupadd -o -g 600 ops
B. groupadd -f -g 600 ops
C. groupadd -g 600 ops
D. 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?

Password Management Hard
A. Set the account expiry date to the current date
B. Deleted alice's password hash entirely from /etc/shadow
C. Set alice's shell to /sbin/nologin
D. Prepended a ! 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 Hard
A. usermod -b /data/sam sam
B. usermod -d /data/sam -M sam
C. usermod -d /data/sam sam
D. 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?

Important Files: /etc/passwd and /etc/group Hard
A. Yes, wheel appears because it is both the primary group and a listed supplementary member
B. No, listing the same user in both files invalidates the group entry
C. Yes, but only after running grpconv to synchronize the files
D. No, because primary group membership is only recorded in /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?

useradd Hard
A. Shell /bin/zsh; home directory created
B. Shell /bin/bash; no home directory created
C. Shell /bin/zsh; no home directory created
D. Shell /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 Hard
A. The group has a GID below 1000 and is protected
B. groupdel requires the -f flag for any non-empty group
C. You cannot remove the primary group of an existing user
D. A group cannot be removed while it still has supplementary members

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?

Password Management Hard
A. Day 75
B. Day 65
C. Day 70
D. Day 60

55 An admin runs usermod -L -e 1 grace. What is the combined effect?

usermod Hard
A. Locks the password only; the account remains fully usable via SSH keys
B. Locks the password and schedules expiry one day from now
C. Locks the password AND expires the account (day 1 from epoch), disabling all login methods
D. Unlocks the password and sets a one-day expiry

56 A corrupted /etc/passwd line reads:


henry:x:1007:1007:Henry:/home/henry


What is the effect of the missing seventh field?

Important Files: /etc/passwd and /etc/group Hard
A. The account is treated as a system account with no shell access
B. Login fails because the shell field is mandatory and blank
C. The GECOS field absorbs the missing shell, breaking the account
D. The system substitutes /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?

User Accounts and Groups Hard
A. Group membership is loaded at session start, so the current shell's credentials are stale until newgrp starts a new shell with updated groups
B. newgrp rewrites /etc/group while re-login only reads /etc/passwd
C. Re-login clears the supplementary group cache permanently
D. 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?

groupmod Hard
A. The command fails if any files reference the old name
B. Files remain correctly group-owned because only the name changed, not the GID
C. Files must be re-chgrp'd because the GID changed
D. Files become orphaned since the group name is used on the inode

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?

userdel Hard
A. Julia is denied access to those files because the username differs
B. Julia automatically owns and can access ivan's old files because the UID matches
C. The old files are automatically deleted when the UID is reused
D. The files become owned by root for security reasons

60 An admin runs useradd -u 0 -o -g 0 shadowroot. What is the outcome and its significance?

useradd Hard
A. The command fails because UID 0 is reserved for root only
B. It creates a system account limited to group 0 but without root powers
C. It creates a second account with full root privileges due to UID 0
D. It creates an unprivileged account whose name happens to differ from root