CCNA User Group Management Questions

13 of 88 questions · Page 2/2 · User Group Management topic · Answers revealed

76
MCQmedium

A system administrator needs to create a shared group 'projectx' and add existing users 'bob' and 'carol' to it. The users need to collaborate on files in a directory /projectx. What is the correct sequence of commands to set up the group and ensure new files created in /projectx are automatically owned by the group 'projectx'?

A.groupadd projectx; usermod -G projectx bob carol; chmod 2770 /projectx
B.addgroup projectx; adduser bob projectx; adduser carol projectx; chmod u+s /projectx
C.groupadd projectx; usermod -aG projectx bob; usermod -aG projectx carol; chmod g+s /projectx
D.groupadd projectx; usermod -G projectx bob; usermod -G projectx carol; chmod g+s /projectx
AnswerC

Correct commands to add to group and set setgid.

Why this answer

Option B is correct because -aG adds supplemental groups without removing existing ones; g+s sets the setgid bit so new files inherit group. Option A is wrong because -G without -a replaces all groups. Option C is wrong because usermod -G without -a and also passing two users is not valid syntax.

Option D uses invalid commands or options (adduser is distribution-specific and chmod u+s is setuid, not setgid).

77
MCQhard

After deleting user 'alice', the system administrator wants to also remove the home directory and mail spool. Which command should be used?

A.userdel -Z alice
B.userdel -r alice
C.userdel -f alice
D.userdel --remove alice
AnswerB

-r removes home directory and mail spool.

Why this answer

Option A is correct because userdel -r removes the home directory and mail spool (if owned by the user).

78
Matchingmedium

Match each Linux boot component to its description.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Boot loader that loads the kernel

Initial RAM filesystem used before root is mounted

Init system and service manager

Core of the operating system

Program that loads the OS into memory

Why these pairings

These components are essential in the Linux boot process.

79
MCQhard

After attempting to log in as user 'alice', the system rejects the password. The admin checks /etc/passwd and sees 'alice:x:1001:1001::/home/alice:/bin/bash'. The /etc/shadow shows 'alice:!!:18200:0:99999:7:::', indicating the account is locked. Which command will unlock the account?

A.passwd -S alice
B.passwd -u alice
C.usermod -U alice
D.chage -d 0 alice
AnswerC

Correctly unlocks the user account password.

Why this answer

Option B is correct because usermod -U unlocks the password. Option A (passwd -u) is available on some systems but not standard across all Linux distributions. Option C sets the password to expire immediately, which does not unlock.

Option D shows password status only.

80
MCQeasy

An administrator wants to add user 'bob' to the supplementary group 'docker' without removing bob from any existing groups. Which command accomplishes this?

A.usermod -g docker bob
B.usermod -aG docker bob
C.usermod -G docker bob
D.usermod -G docker bob
AnswerB

-aG appends docker to the list of supplementary groups.

Why this answer

Option B is correct because the `-a` (append) flag combined with `-G` (supplementary groups) ensures user 'bob' is added to the 'docker' group without removing him from any existing supplementary groups. Without `-a`, the `-G` flag replaces the user's current supplementary group list with the specified groups.

Exam trap

The trap here is that candidates often confuse `-g` (primary group) with `-G` (supplementary groups) and overlook the necessity of the `-a` flag to append rather than replace supplementary group memberships.

How to eliminate wrong answers

Option A is wrong because `-g` sets the primary group (GID) for the user, not a supplementary group; this would change bob's primary group to 'docker' and remove him from his current primary group. Option C is wrong because `-G` without `-a` replaces all supplementary groups with the specified group(s), effectively removing bob from any other supplementary groups he belongs to. Option D is wrong for the same reason as C — it is identical to C and lacks the `-a` flag, causing group replacement.

81
MCQmedium

Existing user 'jdoe' is a member of groups 'users' (primary) and 'staff'. The administrator needs to add 'jdoe' to group 'projectx' while preserving existing supplementary group memberships. Which command achieves this?

A.usermod -g projectx -G projectx jdoe
B.usermod -g projectx jdoe
C.usermod -G projectx jdoe
D.usermod -a -G projectx jdoe
AnswerD

-a appends to current supplementary groups; -G specifies group(s).

Why this answer

Option A is correct because usermod -a -G appends to supplementary groups without removing others. Option B (-G alone) would replace all supplementary groups with only 'projectx', losing 'staff'. Option C and D alter primary group.

82
MCQeasy

A system administrator needs to create a user account for a temporary contractor. The account should have a home directory under /home/contractors, the login shell should be /bin/bash, and the user should be a member of the 'contractors' group. Which command accomplishes this?

A.useradd -m -d /home/contractors/tempuser -s /bin/bash -G contractors tempuser
B.useradd -m -h /home/contractors/tempuser -s /bin/bash -g contractors tempuser
C.useradd -m -d /home/contractors/tempuser -s /bin/bash -p contractors tempuser
D.useradd -m -d /home/contractors/tempuser -s /bin/bash -g contractors tempuser
AnswerD

Correct syntax: -m creates home if missing, -d sets home path, -s sets shell, -g sets primary group.

Why this answer

Option B is correct because useradd -m creates a home directory, -d specifies the home directory path, -s sets the shell, and -g sets the primary group. Option A is wrong because -G sets supplementary groups, not primary. Option C wrongly uses -h for home.

Option D wrongly uses -p for password.

83
Multi-Selecthard

Which THREE files are directly related to user and group management in a Linux system? (Select three.)

Select 3 answers
A./etc/sudoers
B./etc/login.defs
C./etc/group
D./etc/passwd
E./etc/shadow
AnswersC, D, E

Contains group definitions.

Why this answer

The files /etc/passwd, /etc/group, and /etc/shadow are the core local databases for user and group management. /etc/passwd stores user account information (username, UID, GID, home directory, shell), /etc/group stores group definitions (group name, GID, member list), and /etc/shadow stores encrypted password hashes and password aging data. These three files are directly consulted by commands like useradd, usermod, groupadd, and login for authentication and identity management.

Exam trap

The trap here is that candidates may confuse configuration files like /etc/sudoers or /etc/login.defs with the actual user/group database files, but the question specifically asks for files 'directly related to user and group management'—meaning the files that store the user and group records themselves, not files that configure how those records are created or used.

84
Matchingmedium

Match each Linux filesystem hierarchy standard (FHS) directory to its purpose.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Host-specific configuration files

Variable data like logs and databases

Secondary hierarchy for user utilities

Virtual filesystem for process and kernel info

Temporary files

Why these pairings

These directories are part of the FHS standard.

85
MCQeasy

Refer to the exhibit. The administrator attempted to create a user 'newuser' but received an error. Which command should be used to check if the user already exists?

A.cat /etc/passwd | grep newuser
B.passwd -S newuser
C.usermod -c newuser
D.userdel -v newuser
AnswerA

Looks for the user in the password file.

Why this answer

The simplest way is to check /etc/passwd; the 'id' command can also verify existence.

86
MCQmedium

A user's account needs to be set to expire on a specific date. Which command should the administrator use?

A.usermod -e 2025-01-01 username
B.usermod -c 'expire=2025-01-01' username
C.passwd -x 90 username
D.chage -E 2025-01-01 username
AnswerD

Correct: -E sets expiration date.

Why this answer

Option B is correct: chage -E sets the account expiration date. Option A sets GECOS, not expiration. Option C sets password expiration, not account.

Option D is invalid.

87
Multi-Selecthard

Which THREE of the following statements about the user private group (UPG) scheme are true?

Select 3 answers
A.It is the default scheme in Red Hat-based distributions.
B.The umask 0027 ensures files created are NOT readable by the group.
C.The primary group of a user is a system group with GID less than 1000.
D.It ensures that new files have a default group of the user's private group.
E.Each user is assigned a unique group with the same name as the username.
AnswersA, D, E

Yes, RHEL, Fedora, CentOS default to UPG.

Why this answer

Options A, D, and E are true. A: each user gets a unique group with same name. D: Red Hat-based distributions use UPG by default.

E: new files get the user's private group as default group. B is false because the primary group is the user's private group, not a system group. C is false because umask 0027 gives group read permission, not denies it.

88
MCQeasy

An administrator created a new user 'john' with the default settings, but 'john' cannot log in. The error message indicates an invalid shell. Which command should the administrator use to fix this issue?

A.passwd -s john
B.useradd -s /bin/bash john
C.chsh -s /bin/bash john
D.usermod -s /bin/bash john
AnswerD

usermod modifies an existing user; -s sets the login shell.

Why this answer

The user's shell is likely set to /sbin/nologin or a non-existent shell. usermod -s /bin/bash changes the shell to a valid one.

← PreviousPage 2 of 2 · 88 questions total

Ready to test yourself?

Try a timed practice session using only User Group Management questions.