The directory /srv/keys is drwx--x--x and owned by root. It contains deploy.pem with mode 644. User carol has been told the full path of that file. What can carol do?
LPIC-1 Exam 101-500, objective 104. Devices, Linux filesystems, filesystem hierarchy standard hard
Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.
Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
The options
Correct She can open /srv/keys/deploy.pem and read it, but `ls /srv/keys` is refused.
Correct. Execute on a directory grants the right to traverse it and resolve a name inside it; read is what grants the right to list the names, and it is absent.
Not correct She can list the directory but cannot open any file inside it.
Wrong, and it is the mirror image of the truth. That is what r-- would give: names visible, but nothing beyond them reachable.
Not correct Both listing and opening fail, because the execute bit is meaningless on a directory.
Wrong. Execute is very meaningful on a directory: without it, no path through that directory can be resolved at all.
Not correct Both listing and opening succeed, because execute permission on a directory implies read permission.
Wrong. The two bits are independent, and this mode deliberately grants one without the other.
Why
The permission bits mean different things on a directory: read allows the list of names to be retrieved, write allows names to be added, renamed or removed, and execute (the search bit) allows the directory to be used as a component of a path. Mode 711 on a directory is therefore a standard trick — its contents can be reached by anyone who already knows a name, but cannot be enumerated — and it is why a per-user home directory is sometimes given mode 711. Every directory along a path needs execute permission before the final file's own mode is even consulted.
Where this comes from
- Cited
- manual page path_resolution(7)
Practise this
Reading one question is not practice. The trainer will draw a short set from objective 104 and space the ones you get wrong.
More questions on this objective
- A new disk /dev/sdb has no partition table at all. Which command writes an empty GPT partition table onto it without dropping you into an interactive editor? machine-checked
- You need the partition /dev/sdc1 on a USB stick to carry a FAT32 filesystem so that Windows machines can read and write it. Which command creates it? machine-checked
- You have just run `mkswap /dev/sdb2`. Which command makes the kernel start using that swap area immediately, without a reboot? machine-checked
- Why is it dangerous to run e2fsck against an ext4 filesystem that is currently mounted read-write? machine-checked
- On an ext4 filesystem at /dev/sda1 you want an automatic check to be forced after every 30 mounts. Which command sets that? machine-checked
- `df -h /var` reports the filesystem 100% full, but `du -sh /var` accounts for only about half that space. Nothing is hidden under a mount point. What is the most likely explanation? machine-checked
All questions on Devices, Linux filesystems, filesystem hierarchy standard