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.
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)- A84% (48)
- B11% (6)
- C2% (1)
- D4% (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.
'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.
'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.
'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.
'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
Community Discussion
No community discussion yet for this question.