Courseiva
Essential CommandshardMultiple ChoiceObjective-mapped

LFCS Essential Commands Practice Question

Exhibit

Refer to the exhibit.

$ ls -l /usr/local/bin/backup.sh
-rwx------ 1 root root 1024 Jan  1 12:00 /usr/local/bin/backup.sh

$ sudo -u backup /usr/local/bin/backup.sh
sudo: unable to execute /usr/local/bin/backup.sh: Permission denied

$ id backup
uid=1003(backup) gid=1003(backup) groups=1003(backup)

The backup script fails to run as user 'backup' with sudo. What is the issue?

⚠ Common exam trap

Many candidates assume sudo bypasses all file permission checks, but in reality, sudo only bypasses the permission to run the command as another user—the kernel still enforces file execute permissions on the target script.

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

The script does not have execute permission for the 'backup' user.

For a script to be executed via sudo, the user (backup) must have execute permission on the script file. Even if sudo is configured to allow the user to run the script, the operating system enforces file permission checks at execution time. Without the execute bit set for the backup user (or for others, depending on the sudo runas context), the kernel will refuse to execve() the script, resulting in a 'Permission denied' error.

Answer analysis

Option-by-option breakdown

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

  • The script has a restrictive umask.

    Why it's wrong here

    Umask affects new files, not existing permissions.

  • The script does not have execute permission for the 'backup' user.

    Why this is correct

    Only root has execute permission.

  • The script is not owned by 'backup'.

    Why it's wrong here

    Ownership is not the issue; execute permission is missing.

  • The 'backup' user is not in the sudoers file.

    Why it's wrong here

    sudo is working, but the script is not executable.

About these practice questions

One of 507 original LFCS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.