Bird
Raised Fist0
Cybersecurityknowledge~20 mins

File permissions and access control in Cybersecurity - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
File Permissions Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Basic File Permission Types

Which of the following best describes the write permission on a file in a typical operating system?

AAllows a user to modify or delete the contents of the file.
BAllows a user to execute the file as a program or script.
CAllows a user to view the contents of the file without making changes.
DAllows a user to change the ownership of the file.
Attempts:
2 left
💡 Hint

Think about what it means to be able to change a file's content.

📋 Factual
intermediate
2:00remaining
File Permission Representation in Unix

In Unix-like systems, what does the permission string -rwxr-x--x indicate about the file's access?

AOwner has no permissions; group can read and execute; others can write only.
BOwner can read and write; group can execute only; others have no permissions.
COwner can execute only; group can read and write; others can read only.
DOwner can read, write, execute; group can read and execute; others can execute only.
Attempts:
2 left
💡 Hint

Break down the string into owner, group, and others permissions.

🚀 Application
advanced
2:00remaining
Applying Access Control Lists (ACLs)

A file has standard permissions set to rw-r-----. The owner is Alice, the group is 'staff'. An ACL entry grants user Bob read and write access. What is the effective permission for Bob?

ABob has read and write access due to the ACL entry.
BBob has no access because he is not the owner or in the group.
CBob has read-only access because of the group permissions.
DBob has execute permission only.
Attempts:
2 left
💡 Hint

ACLs can grant specific permissions beyond standard owner/group/others.

🔍 Analysis
advanced
2:00remaining
Analyzing Permission Risks

Which of the following file permission settings poses the greatest security risk on a multi-user system?

AFile permissions set to <code>rw-r-----</code> with owner and group properly assigned.
BFile permissions set to <code>r--r-----</code> with restricted write access.
CFile permissions set to <code>rwxrwxrwx</code> allowing all users full access.
DFile permissions set to <code>rw-r-----</code> but with no execute permission.
Attempts:
2 left
💡 Hint

Consider what happens when everyone can read, write, and execute a file.

❓ Reasoning
expert
2:00remaining
Determining Effective Permissions with Multiple Groups

User Charlie belongs to groups 'dev' and 'qa'. A file has owner 'Alice', group 'dev', and permissions rw-r-----. The 'qa' group has an ACL entry granting read access to the file. What is Charlie's effective permission?

ACharlie has execute permission due to group membership.
BCharlie has read-only access because of the ACL entry for 'qa' group.
CCharlie has no access because only the owner has write permission.
DCharlie has read and write access because he is in the 'dev' group.
Attempts:
2 left
💡 Hint

Consider how ACLs and group memberships combine to determine access.

Practice

(1/5)
1. What does the read permission allow a user to do with a file?
easy
A. Modify the contents of the file
B. View the contents of the file
C. Execute the file as a program
D. Delete the file

Solution

  1. Step 1: Understand the meaning of read permission

    The read permission allows a user to open and see the contents of a file without changing it.
  2. Step 2: Compare with other permissions

    Write permission allows changes, execute allows running the file, and delete is a separate action.
  3. Final Answer:

    View the contents of the file -> Option B
  4. Quick Check:

    Read permission = View file contents [OK]
Hint: Read means viewing file contents only [OK]
Common Mistakes:
  • Confusing read with write permission
  • Thinking read allows file execution
  • Assuming read allows file deletion
2. Which of the following is the correct symbolic notation for giving the owner execute permission on a file in Unix/Linux?
easy
A. u+x
B. g+x
C. o+x
D. a+x

Solution

  1. Step 1: Understand symbolic notation for permissions

    In Unix/Linux, 'u' stands for user (owner), 'g' for group, 'o' for others, and 'a' for all.
  2. Step 2: Identify execute permission addition

    Adding execute permission is done with '+x'. So 'u+x' means add execute for owner.
  3. Final Answer:

    u+x -> Option A
  4. Quick Check:

    Owner execute permission = u+x [OK]
Hint: u means owner; +x adds execute permission [OK]
Common Mistakes:
  • Using g+x or o+x for owner permissions
  • Confusing a+x with owner only
  • Misunderstanding symbolic letters
3. Given the file permission string -rwxr-x---, which users can execute the file?
medium
A. Owner and group members
B. Only the owner
C. Everyone
D. Only others

Solution

  1. Step 1: Break down the permission string

    The string '-rwxr-x---' means: owner has read, write, execute; group has read and execute; others have no permissions.
  2. Step 2: Identify who can execute

    Owner (rwx) can execute, group (r-x) can execute, others (---) cannot.
  3. Final Answer:

    Owner and group members -> Option A
  4. Quick Check:

    Execute permission for owner and group [OK]
Hint: Look for 'x' in owner and group parts [OK]
Common Mistakes:
  • Ignoring group execute permission
  • Assuming others have execute
  • Misreading permission string
4. A user tries to write to a file but gets a 'Permission denied' error. The file permissions are -rw-r--r--. What is the most likely cause?
medium
A. User has execute permission but not write
B. File is read-only for everyone
C. User is not the owner and has no write permission
D. File is locked by another process

Solution

  1. Step 1: Analyze the permission string

    '-rw-r--r--' means owner can read and write; group and others can only read.
  2. Step 2: Understand user's permission

    If the user is not the owner, they only have read permission, so writing is denied.
  3. Final Answer:

    User is not the owner and has no write permission -> Option C
  4. Quick Check:

    Write denied if not owner with write permission [OK]
Hint: Write permission only for owner here [OK]
Common Mistakes:
  • Assuming read means write allowed
  • Confusing execute with write permission
  • Ignoring ownership in permissions
5. You want to allow a group of users to read and execute a script but prevent them from modifying it. Which permission setting should you apply?
hard
A. Set group permissions to ---
B. Set group permissions to rw-
C. Set group permissions to rwx
D. Set group permissions to r-x

Solution

  1. Step 1: Understand required permissions

    Users need to read and execute but not write (modify) the script.
  2. Step 2: Match permissions to requirements

    'r-x' means read and execute allowed, write denied. 'rw-' allows write, 'rwx' allows all, '---' denies all.
  3. Final Answer:

    Set group permissions to r-x -> Option D
  4. Quick Check:

    Read + execute, no write = r-x [OK]
Hint: r-x means read and execute, no write [OK]
Common Mistakes:
  • Choosing rw- which allows writing
  • Choosing rwx which allows all permissions
  • Choosing --- which denies access