Permissions, ownership, and the two kinds of link
Objectives 104.5 and 104.6 cover permissions, ownership and links. This guide watches the umask decide a new file's mode, sets permissions in both spellings, shows what execute means on a directory, works through setuid, setgid and sticky - including a setgid bit that survives chmod 1777 - and separates a hard link from a symbolic one by deleting what they point at.
101: Devices and Filesystems Guide 27 of 33 Beginner
- OSUbuntu 26.04 LTS
- Kernel7.0.0-30-generic
- systemd259
- TimeAbout 24 min
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC1-A01 | 192.168.0.76 | Ubuntu 26.04 LTS | Debian-family host - dpkg and apt, which objective 102.4 names | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a file is unreadable by someone who should be able to read it, or before granting a shared directory to a team. This matters because two of these rules are counter-intuitive: a directory needs execute permission for its contents to be opened at all, and a numeric chmod does not clear a directory's setgid bit.
- reading the umask and predicting the mode a new file and directory will get
- setting permissions octally and symbolically, and knowing when
=differs from+ - seeing a directory list its contents while refusing to open them
- using setuid, setgid and sticky - and clearing a setgid bit that
chmod 1777left behind - telling a hard link from a symbolic one by inode, link count, and what happens when the target is deleted
Before you start
- partitions-filesystems-and-fstab
-
The mode a new file gets, and what decided it
-
chmod, in both spellings
-
What execute means on a directory
-
The three bits above the nine
-
The setgid bit that survived a numeric chmod
-
Ownership, which only root can give away
-
The two kinds of link
-
Putting the machine back