• Post author:
  • Post category:Blog
  • Reading time:2 mins read
  • Post last modified:June 12, 2024

Given the ls command output that is shown below, what command will permit only the user owner and members of the “staff” group to read or modify the testpcap file?

$ ls -l test
-rw-r--r-- 1 jdoe staff 57 Nov  3 10:13  testpcap
  • chmod 660 testpcap
  • chmod 550 testpcap
  • chmod o+rw testpcap
  • chmod staff+rw testpcap
Explanation & Hint:

To permit only the user owner (jdoe) and members of the “staff” group to read or modify the testpcap file, you should use the chmod command as follows:

chmod 660 testpcap

This command sets the permissions as follows:

  • 6: Read and write permission for the user owner (jdoe).
  • 6: Read and write permission for the members of the “staff” group.
  • 0: No permission for others (those not the owner or in the “staff” group).

So, with these permissions, the user owner (jdoe) and members of the “staff” group can read and modify the file, while others have no access.

For more Questions and Answers:

Endpoints and Systems Post-Assessment | CBROPS

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments