nerdexam
CompTIA

XK0-004 · Question #420

An administrator needs to run the rescript. sh script stored on the /nr.t/disk Wesystem. but permission is denied; The system options are: The script properties are: Which of the following will resolv

The correct answer is A. mount -o remount, rw /mnt/disk. A permission denied error when executing a script on a mounted filesystem is resolved by remounting the filesystem with read-write access.

Troubleshooting and Diagnostics

Question

An administrator needs to run the rescript. sh script stored on the /nr.t/disk Wesystem. but permission is denied; The system options are:

The script properties are:

Which of the following will resolve the issue?

Options

  • Amount -o remount, rw /mnt/disk
  • Bchcon-u system_u -t admin_home_/mnt/disk/ myscript.sh
  • Cmount -o remount, exec .mnt/disk
  • Dsetenforce permissive

How the community answered

(57 responses)
  • A
    84% (48)
  • B
    11% (6)
  • C
    2% (1)
  • D
    4% (2)

Why each option

A permission denied error when executing a script on a mounted filesystem is resolved by remounting the filesystem with read-write access.

Amount -o remount, rw /mnt/diskCorrect

'mount -o remount,rw /mnt/disk' changes the active mount options of the filesystem from read-only to read-write without unmounting it, removing the filesystem-level restriction that caused the permission denial. When a filesystem is mounted read-only, script execution can fail at the VFS layer regardless of the file's permission bits.

Bchcon-u system_u -t admin_home_/mnt/disk/ myscript.sh

'chcon' modifies SELinux file context labels and affects MAC policy enforcement, but does not change the filesystem mount options that are responsible for the read-only permission denial.

Cmount -o remount, exec .mnt/disk

'mount -o remount,exec' removes the noexec mount restriction but does not address a read-only mount flag, which is a separate option that independently denies write-dependent operations.

Dsetenforce permissive

'setenforce permissive' switches SELinux enforcement to permissive mode and only affects mandatory access control policy, not POSIX filesystem-level read-only restrictions.

Concept tested: Remounting read-only filesystems with rw permissions

Source: https://man7.org/linux/man-pages/man8/mount.8.html

Topics

#mount options#noexec#remount#filesystem permissions

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice