nerdexam
IBM

000-221 · Question #95

An administrator has logged in as root but is unable to run the ksh script named rperf. Given the following information, how could this be fixed?

The correct answer is D. Change the permissions to 700. A root user unable to execute a script is caused by the execute permission bit not being set on the file, which is resolved by setting permissions to 700.

Security

Question

An administrator has logged in as root but is unable to run the ksh script named rperf. Given the following information, how could this be fixed?

Exhibit

000-221 question #95 exhibit

Options

  • AChange the parent directory to be executable
  • BChange the owner of the script to root
  • CChange the file to be of extension ksh
  • DChange the permissions to 700

How the community answered

(63 responses)
  • A
    3% (2)
  • B
    10% (6)
  • C
    6% (4)
  • D
    81% (51)

Why each option

A root user unable to execute a script is caused by the execute permission bit not being set on the file, which is resolved by setting permissions to 700.

AChange the parent directory to be executable

Parent directory execute permission controls the ability to traverse or search the directory, not to execute files within it; the script file itself must have the execute bit set.

BChange the owner of the script to root

Changing ownership to root is irrelevant when already running as root and does not address missing execute permissions on the file.

CChange the file to be of extension ksh

AIX and Linux do not use file extensions to determine executability; only the execute permission bit in the inode controls whether a file can be run.

DChange the permissions to 700Correct

Setting permissions to 700 (rwx------) grants the file owner read, write, and execute permissions, which is the minimum required for the owner to run the script directly. In AIX and Linux, the execute bit must be explicitly set on a file - even root cannot invoke a script by name without it, though root can bypass read/write restrictions.

Concept tested: AIX file execute permissions and chmod

Source: https://www.ibm.com/docs/en/aix/7.3?topic=c-chmod-command

Topics

#file permissions#chmod#script execution#permission bits

Community Discussion

No community discussion yet for this question.

Full 000-221 Practice