nerdexam
CompTIA

XK0-005 · Question #10370

User1 is a member of the accounting group. Members of this group need to be able to execute but not make changes to a script maintained by User2. The script should not be accessible to other users…

The correct answer is A. chown user2:accounting script.sh. chown user2:accounting script.sh Sets the file owner to user2 (who maintains the script) and the group to accounting (which includes user1). chmod 750 script.sh Sets permissions to: 7 (owner = user2) → read, write, execute 5 (group = accounting) → read, execute only (no write)…

System Management

Question

User1 is a member of the accounting group. Members of this group need to be able to execute but not make changes to a script maintained by User2. The script should not be accessible to other users or groups. Which of the following will give proper access to the script?

Options

  • Achown user2:accounting script.sh
  • Bchown user1:accounting script.sh
  • Cchown accounting:user1 script.sh
  • Dchown user2:accounting script.sh

How the community answered

(37 responses)
  • A
    84% (31)
  • B
    8% (3)
  • C
    5% (2)
  • D
    3% (1)

Explanation

chown user2:accounting script.sh Sets the file owner to user2 (who maintains the script) and the group to accounting (which includes user1). chmod 750 script.sh Sets permissions to: 7 (owner = user2) → read, write, execute 5 (group = accounting) → read, execute only (no write) 0 (others) → no permissions This setup ensures: Only user2 can modify the script. Members of accounting (like user1) can execute but not edit it. Other users have no access, as required.

Topics

#Linux file permissions#File ownership#chown command#User and group management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice