Linux File Permission Practice: Can This User Do It?
Unlimited Linux file permission practice. Each problem shows one user, a file and its directory as ls -l prints them: decide if the user can do it, then tap what decides it. A wrong answer names the slip, such as checking the bits of the file for a delete. A harder level adds ACLs.
The user
The file and its directory
What decides it?
The checks
Users, groups and files are invented. The user is never root and has no special privileges. Group is the effective group, and Also in lists the supplementary groups. Symbolic links, mount options, default ACLs and SELinux are left out.
To convert a mode instead, use the chmod calculator or the umask calculator.
Linux exam prep
Managing file permissions and ownership is objective 104.5 of the LPIC-1 exam 101, and the RHCSA exam lists standard ugo/rwx permissions. Start with the free real exam questions, then get the full pack.
Permission FAQ
Which permission bits apply to a user on Linux?
Only one group of three bits is used. The owner bits are used when the user owns the file. Otherwise the group bits are used when the group of the file is the effective group of the user or one of the supplementary groups. When neither holds, the other bits are used.
Can the owner of a file be denied when the group bits would allow it?
Yes. For the owner the first group of three bits is the one that is used, so an owner with r-- cannot write to the file even when the group and other bits include w. In the same way a member of the group gets the group bits even when the other bits allow more.
What do you need to delete a file on Linux?
Write permission on the directory that holds the file, and search permission on that directory. The permission bits of the file itself are not part of the check, so write permission on a file does not let you delete it.
What does the sticky bit do on a directory?
A file in a sticky directory can be renamed or deleted only by the owner of the file, by the owner of the directory, and by a privileged process. ls -l prints it as t in the last place of the mode when the other execute bit is also set.
What does the set-group-ID bit do on a directory?
Files created there inherit their group from the directory, not from the effective group of the process that creates them. ls -l prints it as s in the group bits when the group execute bit is also set.
What is search permission on a directory?
For a directory the last bit of each group of three is search permission, not execute permission. Without it a name in that directory cannot be looked up and the call fails with EACCES, Permission denied, whatever the bits of the file say.
What do you need to create a file in a directory?
Write permission on the parent directory, and search permission on the directories in the path. The sticky bit is about renaming and deleting, so it does not stop a user from creating a file.
How does Linux check access when a file has an ACL?
In a fixed order. The owner gets the user:: entry. Otherwise a user with a named user entry gets that entry, limited by the mask. Otherwise, if the file group or a named group entry matches one of the groups of the user, access is granted when the mask and any one of the matching group entries contain the permission. Only a user who matches none of these gets the other entry.
What does the mask do in an ACL?
The mask is the most that named user entries, the group entry and named group entries can grant. The owner entry and the other entry are not limited by it. On a file with an ACL the group bits that ls -l prints are the mask, not the group entry, and ls marks the file with a + after the mode.
Which Linux exams cover file permissions?
The LPIC-1 exam 101 objectives list 104.5 Manage file permissions and ownership. The Red Hat RHCSA EX200 exam page lists "List, set, and change standard ugo/rwx permissions" and "Manage default file permissions".
How is this different from a chmod calculator?
A chmod calculator converts a mode between rwx letters and octal digits. This drill starts from a listing and asks what one user can do with the file, which is the step after reading the mode.
What does this drill leave out?
Root and capabilities, symbolic links, mount options, immutable and append-only files, SELinux, set-user-ID programs, renaming and default ACLs. The user is never root. A sticky directory always has the other execute bit and a set-group-ID directory always has the group execute bit, so the listing shows t and s. In the ACL level the ACL is on the file only, always with six entries, and the directory always lets the user reach the file.
Sources
- Linux man-pages project, path_resolution(7): one group of three permission bits is used (owner, else group including the supplementary groups, else other); read, write, and execute for ordinary files or search for directories; a lookup in a directory without search permission returns EACCES.
- Linux man-pages project, unlink(2): deleting fails with EACCES without write access to the directory or without search permission, and in a sticky directory when the user owns neither the file nor the directory.
- Linux man-pages project, open(2): creating a file fails with EACCES when write access to the parent directory is not allowed.
- Linux man-pages project, inode(7): the sticky bit on a directory, the set-group-ID bit on a directory and the group of newly created files.
- acl project manual pages, acl(5) (ACCESS CHECK ALGORITHM, and the mask as the group permission bits) and getfacl(1) (the output lines, the options -c and -E, and the mask not limiting the owner and other).
- GNU Coreutils manual, What information is listed: the long format of ls, the letters s and t in the mode and the + after it.
- Linux Professional Institute, Exam 101 objectives (objective 104.5), and Red Hat, EX200 RHCSA exam page.
- Checked 21 November 2026. The Linux man-pages project documents the Linux kernel and C library interfaces, and the acl project maintains the ACL tools. Neither is an exam owner, and the exam pages above do not list ACLs. The tool's own approach: users, groups and files are invented; the cases listed under "What does this drill leave out?" never appear; "The checks" puts the documented steps into five lines; for "run", execute permission never comes without read permission. An independent re-solver (octal bit masks worked out from the printed listing) agreed with the drill on 20,000 generated problems.
Checked 21 November 2026 against the Linux man-pages project, the acl project manual pages, the GNU Coreutils manual, the LPI exam 101 objectives and the Red Hat EX200 exam page.
- Calculatorchmod calculatorLinux file permissions as numbers, letters and the exact chmod command, including SUID, SGID and the sticky bit.
- BuilderCron expression builderBuild a 5-field crontab schedule, read it in plain English and see the next 5 run times.
- CalculatorUmask calculatorThe default file and directory permissions for any umask, or the umask for the permissions you want.