Courseiva
Essential CommandsmediumMultiple ChoiceObjective-mapped

LFCS Essential Commands Practice Question

Exhibit

Refer to the exhibit.

$ ls -l /etc/shadow
-rw-r----- 1 root shadow 1234 Jan 15 10:00 /etc/shadow
$ id
uid=1000(user1) gid=1000(user1) groups=1000(user1)
$ cat /etc/shadow
cat: /etc/shadow: Permission denied

A user with uid 1000 tries to read /etc/shadow and gets 'Permission denied'. The user is not in the shadow group. Which of the following actions would allow the user to read the file without changing the file's group or permissions?

⚠ Common exam trap

Many exam-takers assume ACLs (setfacl) are not a 'permission change' and select option A, but ACLs are indeed a form of permission modification and violate the constraint, while group membership addition is a user attribute change, not a file attribute change.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Add user1 to the shadow group using usermod -aG shadow user1

Adding user1 to the shadow group grants group-level read access to /etc/shadow without altering the file's permissions or group ownership. The file is typically owned by root:shadow with permissions 640 (rw-r-----), so members of the shadow group can read it. The usermod -aG command appends the user to the supplementary group, preserving existing group memberships.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Set an ACL using setfacl to grant user1 read access

    Why it's wrong here

    This would work but is not listed as an option; also it changes the file's ACL, which is not 'without changing file's group or permissions'.

  • Use chmod o+r /etc/shadow as root

    Why it's wrong here

    This changes permissions, which is not allowed per the question.

  • Add user1 to the shadow group using usermod -aG shadow user1

    Why this is correct

    Correct: adding to shadow group gives read access via group permission.

  • Change the file owner to user1 using chown

    Why it's wrong here

    Only root can change ownership.

About these practice questions

This LFCS question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.