Unlock hundreds more features
Save your Quiz to the Dashboard
View and Export Results
Use AI to Create Quizzes and Analyse Results

Sign inSign in with Facebook
Sign inSign in with Google

Master Linux File Permissions: Take the Quiz

Ready to conquer chmod, chown, and more? Dive into the Linux permissions quiz!

Difficulty: Moderate
2-5mins
Learning OutcomesCheat Sheet
Paper art illustration showcasing Linux file permissions quiz with chmod chown permission icons on teal background

Ready to test your skills with our Linux file permissions quiz? Dive into a friendly, motivating file permission challenge that puts your mastery of chmod, chown and Linux permissions commands to the test. Whether you're a sysadmin sharpening your toolkit or a curious learner aiming to unlock deeper system control, this quiz will show you where you stand. Explore our interactive file permissions quiz and level up with a hands-on linux command practice session to solidify your knowledge. By the end, you'll confidently navigate read, write, and execute bits and streamline your workflow on any Linux system. Take charge now, prove your expertise, and ace the chmod quiz and chown test with confidence - start the challenge today!

In octal notation, what permission does 644 represent?
rw-r--r--
r--r--r--
rw-rw-r--
rwxr-xr-x
The octal mode 644 means the owner has read and write permissions (6), while group and others have read-only (4). In symbolic form this maps to rw-r--r--. Octal and symbolic modes correspond based on bit weights. Learn more about chmod
Which command is used to change the group ownership of a file?
chown
usermod
chmod
chgrp
The chgrp command is specifically designed to change the group ownership of files or directories. It alters only the group field without affecting the file owner. The chown command can change both owner and group, but chgrp is more focused. chgrp man page
What symbol represents the execute permission in a long listing?
e
r
x
w
In a long listing (ls -l), the execute permission is denoted by 'x'. The three permission types r, w, and x correspond to read, write, and execute. If execute is not set, a dash '-' appears instead. Understanding file permissions
What is the effect of the command chmod u+w file.txt?
Removes write permission for the group
Removes write permission from the user
Adds write permission for others
Adds write permission for the file owner
The symbolic mode u+w tells chmod to add write permission to the user (owner) of the file. It does not affect group or others. Symbolic modes use u, g, o for user, group, and others respectively. chmod man page
Which permission bit allows a user to read a file?
w
r
s
x
The 'r' bit stands for read permission, allowing the user to view the contents of the file. Without it, attempts to open or read the file will be denied. Read is one of the three basic permission types. GNU Coreutils on file permissions
What is the default permission for new directories if umask is 0022?
750
755
700
644
Directories start with a base of 777. A umask of 0022 removes write permissions for group and others, resulting in 755 (rwxr-xr-x). This is the common default for many distributions. Arch Wiki on umask
What does the command chmod 700 script.sh do?
Sets r--r--r--
Sets rw-rw-r--
Sets rwx------
Sets rwxrwxrwx
Mode 700 grants the owner read, write, and execute permissions (7) and removes all permissions for group and others (0). This is useful for scripts that should only be accessed by their owner. chmod man page
Which command displays file permissions in a long listing format?
ls -a
ls -s
ls -h
ls -l
The ls -l command shows a detailed (long) listing, including file permissions, number of links, owner, group, size, and timestamp. It is the standard way to inspect permission bits. GNU ls documentation
What is the purpose of the sticky bit on a directory?
Forces files to be executable
Allows only the owner of a file or directory to delete or rename files within the directory
Prevents anyone from creating files inside
Grants execute permission to all users
When the sticky bit is set on a directory, users can create files but only the file owner, directory owner, or root can delete or rename them. This is common on /tmp to prevent file removal by other users. The permission appears as a 't' in the others execute position. Understanding the sticky bit
What does the setgid bit do when applied to a directory?
Directory is only accessible by the group
Files created inside inherit the group ID of the directory
Files are executed with group privileges
Files have group write removed
Setting the setgid bit on a directory ensures new files and subdirectories inherit the directory's group ID. This helps maintain consistent group ownership in shared directories. It is shown as an 's' in the group execute position. chmod man page
What does the leading '4' in the mode 4755 represent?
default ACL
setgid bit
sticky bit
setuid bit
The leading 4 in an octal mode refers to the setuid bit, which allows an executable to run with the file owner's privileges. In 4755, the owner, group, and others get rwx, r-x, r-x, and setuid is set. chmod detailed options
How would you remove write permissions for group and others symbolically?
chmod og+w
chmod go-w
chmod a-w
chmod g-w,o+w
The symbolic syntax go-w instructs chmod to remove write permission (w) from group (g) and others (o). Using a-w would remove write permission from all (user, group, others). Symbolic modes can target specific categories. chmod symbolic modes
The umask value defines:
The maximum file size
Special permissions for root only
The default permissions that are subtracted from newly created files and directories
ACL entries for new files
A umask specifies permission bits to turn off when new files or directories are created. It does not set permissions directly but masks out unwanted bits. Most systems use it to enforce security policies. Arch Wiki on umask
What is the common default umask value for a regular user?
022
000
777
644
The typical default umask for non-root users is 0022, which removes write permission for group and others. This results in 644 for files and 755 for directories by default. Distributions often set this in shell configuration. umask man page
How do you set both setuid and setgid on an executable file using octal notation?
chmod 7755
chmod 4755
chmod 2775
chmod 6755
In octal, 4 sets setuid and 2 sets setgid. Combining them yields 6 for special bits. Thus chmod 6755 applies both bits and sets permissions rwxr-xr-x. chmod examples
Which command would you use to display both numerical and symbolic permissions for a file?
stat
ls -al
getfacl
chmod -v
The stat command shows file metadata including both numeric and symbolic mode representations. It prints lines like Access: (0755/-rwxr-xr-x). This makes it useful for auditing permissions. stat man page
If your umask is 027, what permissions will a newly created directory have by default?
rw-r--r-- (644)
rwxrwxrwx
rwxr-x--- (750)
rwxrwx---
Directories start at 777 and subtract the umask bits. A umask of 027 removes write for group (2) and all for others (7), yielding 750 or rwxr-x---. This is common in environments requiring tighter group control. Introduction to Linux permissions
Which command displays the ACL entries for a file?
setfacl
ls -l
getfacl
stat
The getfacl command retrieves and shows ACL information for files and directories. It lists default and access ACL entries in an easy-to-read format. This is crucial when auditing extended permissions. getfacl man page
How would you grant the group 'dev' read, write, and execute permissions on file1 using ACLs?
setfacl -a g:dev:rwx file1
setfacl -m g:dev:rw file1
setfacl --grant dev:rwx file1
setfacl -m g:dev:rwx file1
Using setfacl -m (modify) with the g:dev:rwx syntax assigns read, write, and execute permissions to the 'dev' group. The -a option is not valid for ACLs. This modification adds a specific ACL entry. ACL management guide
What effect does the SUID bit have on an executable file?
File's permissions are ignored
File runs with the privileges of the file's owner
File can be executed by any user
File runs with the privileges of the file's group
When the setuid bit is set on an executable, it runs with the file owner's privileges rather than the invoking user's. This is commonly used for programs requiring elevated privileges. It is displayed as an 's' in the owner execute position. chmod man page
In the permission string 'drwxrws---', what does the 's' in the group field indicate?
setgid bit
SUID bit
Default ACL
Sticky bit
An 's' in the group execute position signifies the setgid bit is set on the directory. This causes new files and subdirectories to inherit the directory's group ID. Sticky bits and setuid appear in other positions. Linux permissions explained
Which umask would result in new files having permissions of 644 and new directories having permissions of 755?
002
027
077
022
A umask of 022 removes write permission for group and others, giving files 644 (rw-r--r--) and directories 755 (rwxr-xr-x). Other umasks yield different permission sets. This is the most common default umask. Arch Wiki on umask
How do you remove all ACL entries from a file?
setfacl -m g:: file
chmod a-rwx file
setfacl --remove-all file
getfacl file
The setfacl --remove-all command deletes all access control list entries, reverting to standard Unix permissions. The -m option modifies specific entries, but --remove-all clears them. This is useful when ACL complexity is no longer needed. setfacl man page
What does the 'mask' entry in an ACL represent?
The sticky bit setting
The file's owner permissions
The default umask
The maximum effective permissions for users, groups, and named entries
The ACL 'mask' specifies the upper limit of permissions that ACL entries (user, group, named users/groups) can have. It does not affect the file owner. This entry ensures no ACL entry exceeds intended access. Understanding ACL masks
You have a directory with a default ACL granting group 'staff' rwx on new files, but newly created files lack execute permission. Why?
Because the umask masks out the execute bit on new files
Because the group 'staff' lacks primary membership for the user
Because the setgid bit wasn't set on the directory
Because default ACL entries only apply to directories, not files
Default ACL entries do not override the system umask, which can remove execute bits from new files by default. If your umask prohibits execute permission, ACLs cannot re-add it on file creation. You must adjust the umask or set execute after creation. Dive deeper into ACL behavior
0
{"name":"In octal notation, what permission does 644 represent?", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"In octal notation, what permission does 644 represent?, Which command is used to change the group ownership of a file?, What symbol represents the execute permission in a long listing?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}

Study Outcomes

  1. Understand Linux Permission Model -

    Explain the basic concepts of user, group, and other permissions in Linux and how they control access to files and directories.

  2. Interpret Permission Notations -

    Decode symbolic (rwx) and octal (e.g., 755) permission formats to quickly assess file access rights.

  3. Apply chmod Commands -

    Demonstrate how to use chmod in both numeric and symbolic modes to modify file and directory permissions effectively.

  4. Use chown and chgrp Effectively -

    Perform chown and chgrp operations to change file ownership and group associations with precision.

  5. Analyze Access Scenarios -

    Evaluate real-world examples to determine appropriate permissions settings for different user roles and use cases.

  6. Troubleshoot Permission Errors -

    Identify and resolve common permission-related issues using Linux permissions commands in practical file permission challenge scenarios.

Cheat Sheet

  1. Permission Bits and Numeric Values -

    Every file and directory permission in Linux is defined by three bits: read (4), write (2) and execute (1). Remember the mnemonic "rwx = 4+2+1" to quickly convert symbolic flags to octal values, a core skill for acing any Linux file permissions quiz. According to the Linux Foundation, understanding this mapping powers all effective use of Linux permissions commands.

  2. chmod Syntax and Symbolic Notation -

    The chmod command lets you modify permissions using numeric or symbolic modes; for example, chmod 755 script.sh or chmod u+x,go-w file.txt. Mastering operators like +, -, and = for users (u), groups (g) and others (o) is critical for success in any chmod quiz or real-world task. The Linux Documentation Project highlights that symbolic notation often speeds up permission tweaks on the fly.

  3. Ownership Management with chown and chgrp -

    chown changes file owner and optionally group with syntax like chown alice:developers report.txt, while chgrp flips only the group. Only root or users with sudo privileges can reassign ownership, a principle emphasized in official man pages from major distributions. Practice with these commands to excel in chown tests and reinforce your sysadmin toolkit.

  4. Default Permissions and the umask Formula -

    umask sets the default mask for new files, subtracting from 666 for files and 777 for directories - so a umask of 022 yields 644 for files. Use the formula "default = max perm - umask" to predict new file permissions instantly, a tip backed by Ubuntu's official documentation. Familiarity with umask ensures you maintain secure defaults without extra chmod steps.

  5. Special Permissions: SUID, SGID and Sticky Bit -

    Special bits add advanced controls: SUID (4xxx) runs executables with the file owner's privileges, SGID (2xxx) can enforce group identity, and the sticky bit (1xxx) locks directory deletions to file owners. For instance, chmod 4755 /usr/bin/passwd grants SUID, letting users change passwords securely - an essential concept in any comprehensive file permission challenge. NIST guides highlight these bits as critical for robust access control.

Powered by: Quiz Maker