Lpic 1 Linux Administrator · Free Practice Question Medium

Question 30

Sarah, a junior system administrator, is tasked with managing file permissions on a shared Linux server. She recently created a directory named /project_docs where multiple team members need read and write access. However, she notices that whenever team members create new files in this directory, other members can't edit them due to restrictive permissions. Sarah wants to ensure that all files created within /project_docs are accessible to all team members with read and write permissions by default. Which command should she use to set the appropriate permissions for this directory?

  • A

    chmod 755 /project_docs

  • B

    chown :team /project_docs

  • C

    chmod 2775 /project_docs

  • D

    chmod +t /project_docs

Reveal correct answer

Correct answer: C

A. The command chmod 755 /project_docs sets read, write, and execute permissions for the owner of the directory, but only read and execute permissions for group members and others. This does not ensure that all team members have read and write access to files created within the directory by default.

B. The command chown :team /project_docs changes the group ownership of the directory to 'team'. While this can be useful for managing group ownership, it does not directly address the issue of setting default permissions for files created within the directory.

C. The command chmod 2775 /project_docs sets the permissions of the directory to ensure that all files created within it inherit the group ownership and permissions of the parent directory. The '2' in the command sets the setgid bit, which ensures that new files inherit the group ownership of the parent directory, allowing all team members to have read and write access by default.

D. The command chmod +t /project_docs sets the sticky bit on the directory, which is typically used for ensuring that only the owner of a file can delete it. While this can be useful for certain scenarios, it does not address the issue of setting default permissions for files created within the directory for all team members.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need