Linux
File Permissions & Ownership
26 flashcards · answers and spaced-repetition review in the KnowCard app
You own a file and want to give it away to another user by changing its owner. Why does chown fail for you?
In the first column of ls -l output you see a leading character like d, l, or c before the rwx bits. What does that character encode, and what are the main codes?
In a line like -rw-r--r-- 1 kofler kofler ..., there is a number right after the ten type-and-permission characters. What does that number mean?
Every Linux file carries an owner, a group, and permission bits. How many permission bits are there, and how are they grouped?
A user has no write bit on a file, yet they delete it anyway. How is that possible?
A file is rw-r--r-- and you want every user on the system to be able to read it too. Using symbolic chmod, what command does that?
You want a file to belong to the group docuteam instead of its current group. Which command changes only the group, and who is allowed to run it?
In octal permissions like 640, how is each digit built, and what do 660 and 777 translate to?
ls -l shows permissions as rwx letters, but you want them as an octal number like 640. What tool gives you that, and why not ls?
A user can't access the serial port because /dev/ttyS1 is owned by the dialout group. Without changing the device's permissions, how do you grant access?
The rwx bits mean something different on a directory than on a file. What does each bit actually let you do on a directory?
Why do r and x have such an odd, non-obvious meaning on directories (r = list names, x = enter)?
A directory is chmod 000 but root reads and deletes files in it anyway. Why do the permission bits not stop root?
To create a new file inside a directory, which permissions on the directory do you need — and does the read bit matter?
You set up a shared project directory and add everyone to a group, but files one person creates still land in the wrong group and teammates can't edit them. What one bit fixes this?
When you create a brand-new file with touch, who becomes its owner and group?
You belong to several groups but want new files you create to land in one specific group without running chgrp on each. What command sets that up, and how do you see your group memberships?
New files come out rw-r--r-- (644) even though Linux's base for files is 666. What mechanism removes the missing bits, and how does it compute the result?
What is the typical default umask, and how does Ubuntu's default differ from it?
You want new files to come out rw-r----- (640) and new directories rwxr-x--- (750). What umask value achieves this, and where do you make it permanent?
You set umask 027 in your shell and it works, but new users on the system still get a different default. Where does the system-wide umask actually come from?
A directory has the read bit set, so a user can run plain ls on it — but ls -l on the same directory fails. What extra bit does the detailed listing need?
After copying WordPress into the web root, updates and image uploads fail. What ownership change fixes it, and how does it differ on RHEL?
A subdirectory has wide-open rwx rights, but a user still can't reach a file inside it. What upstream permission is blocking them?
On Debian/Ubuntu other users can run ls -l on your home directory, but on Fedora/RHEL they can't even peek inside. What accounts for the difference?
A new file's group is normally the creator's primary group — but on some systems every user's files land in the same group instead. Why?
Start learning today
Free to start — download the app or use it in your browser.
