nerdexam
CompTIA

PT0-002 · Question #132

Which of the following commands will allow a penetration tester to permit a shell script to be executed by the file owner?

The correct answer is A. chmod u+x script.sh. In Linux/Unix file permissions, chmod uses symbolic notation where u = user (owner), g = group, o = others, and a = all. The permission types are r (read), w (write), and x (execute). The + operator adds a permission. Therefore, chmod u+x script.sh adds execute (x) permission…

Tools and Code Analysis

Question

Which of the following commands will allow a penetration tester to permit a shell script to be executed by the file owner?

Exhibit

PT0-002 question #132 exhibit

Options

  • Achmod u+x script.sh
  • Bchmod u+e script.sh
  • Cchmod o+e script.sh
  • Dchmod o+x script.sh

How the community answered

(53 responses)
  • A
    94% (50)
  • B
    4% (2)
  • D
    2% (1)

Explanation

In Linux/Unix file permissions, chmod uses symbolic notation where u = user (owner), g = group, o = others, and a = all. The permission types are r (read), w (write), and x (execute). The + operator adds a permission. Therefore, chmod u+x script.sh adds execute (x) permission for the file owner (u). Option B and C use e, which is not a valid permission symbol. Option D (chmod o+x) would grant execute permission to others, not the file owner.

Topics

#Linux commands#File permissions#chmod#Shell scripting

Community Discussion

No community discussion yet for this question.

Full PT0-002 Practice