nerdexam
CompTIA

XK0-006 · Question #62

A user on a Linux VM is running /work/test.sh Bash script and receives the following error: bash: /work/test.sh: Permission denied After further investigation, the user receives the following…

The correct answer is A. mount -o remount,exec /work. The script /work/test.sh already has execute permissions (-rwxr--r--), but the filesystem is mounted with the noexec option, which prevents execution of binaries and scripts. Remounting the filesystem with the exec option allows execution of the script.

Troubleshooting

Question

A user on a Linux VM is running /work/test.sh Bash script and receives the following error:

bash: /work/test.sh: Permission denied After further investigation, the user receives the following outputs:

Which of the following commands should a systems administrator run to fix the issue?

Exhibit

XK0-006 question #62 exhibit

Options

  • Amount -o remount,exec /work
  • Bmount -o remount,suid /work
  • Cchmod g+x /work/test.sh
  • Dchmod o+x /work/test.sh

How the community answered

(25 responses)
  • A
    56% (14)
  • B
    4% (1)
  • C
    24% (6)
  • D
    16% (4)

Explanation

The script /work/test.sh already has execute permissions (-rwxr--r--), but the filesystem is mounted with the noexec option, which prevents execution of binaries and scripts. Remounting the filesystem with the exec option allows execution of the script.

Topics

#mount options#noexec#filesystem permissions#script execution

Community Discussion

No community discussion yet for this question.

Full XK0-006 Practice