Permissions Flashcards
7 cards from real Linux practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Permissions flashcards as text
What does the command 'chmod +t /shared' do?
Answer: Sets the sticky bit on the /shared directory
The +t flag in chmod sets the sticky bit on a directory, restricting file deletion to file owners only.
Which file stores the default umask for all users on a system-wide basis on most Linux distributions?
Answer: /etc/profile or /etc/bashrc
System-wide umask settings are typically configured in /etc/profile or /etc/bashrc (or /etc/bash.bashrc on Debian-based systems).
A directory has permissions drwxr-x---. Which users can list its contents?
Answer: The owner and members of the directory's group
Read permission (r) on a directory allows listing its contents; both the owner (rwx) and group members (r-x) have this, but others (---) do not.
What happens when you run chmod u=rwx,g=rx,o= file.txt?
Answer: Owner gets rwx, group gets r-x, others get no permissions
The = operator sets permissions exactly; u=rwx gives owner full access, g=rx gives group read+execute, and o= removes all permissions from others.
Which special permission bit, when set on an executable file, causes it to run with the privileges of the file's group?
Answer: setgid bit
The setgid bit on an executable causes it to run with the effective GID of the file's group rather than the caller's GID.
What does 'ls -l' display when a file has extended ACLs in addition to standard permissions?
Answer: A '+' sign after the permission string
When a file has extended ACLs, ls -l shows a '+' at the end of the permission string to indicate additional access control entries exist.
A script file has permissions -rw-r--r--. What must be done before a user can execute it directly?
Answer: Add execute permission with chmod +x
A file must have the execute bit set (at minimum for the running user) before it can be executed directly as a script or binary.