~2 min read • Updated Jul 18, 2025
1. Introduction to Multiuser Unix Systems
Unix systems support multiple users and concurrent tasks. Users can log in locally or remotely via SSH. Graphical interfaces can even be displayed remotely using the X Window System. This multiuser architecture stems from Unix's roots in shared academic computing.
2. Ownership and Group Structure
Each file in Unix is assigned:
- User ID (UID): representing the file owner
- Group ID (GID): linking to a group
- Group memberships: user may belong to multiple groups
id
# uid=500(me) gid=500(me) groups=500(me)User, group, and shadow information are stored in /etc/passwd, /etc/group, and /etc/shadow.
3. File Permission Types
- Read (r): view contents or list directory
- Write (w): modify contents or add/delete files
- Execute (x): run scripts or enter directories
File Type Indicators
| Indicator | File Type |
|---|---|
| - | Regular file |
| d | Directory |
| l | Symbolic link |
| c | Character device |
| b | Block device |
Example Output
-rw-rw-r-- 1 me me 0 foo.txtInterpretation: owner and group have read/write access; others have read-only access.
4. Changing Permissions with chmod
Permissions can be changed using:
- Octal notation: e.g.,
chmod 600 foo.txt - Symbolic notation: e.g.,
chmod u+x script.sh
chmod 600 foo.txt
chmod u+x script.sh
chmod g+w shared.txt
5. Default Permissions with umask
The umask subtracts from default base permissions:
- Files: 666
- Directories: 777
umask 0002
# Results in: -rw-rw-r--6. Special Permission Bits
| Bit | Description | Example |
|---|---|---|
| Setuid (4000) | Run with owner’s privileges | -rwsr-xr-x |
| Setgid (2000) | Preserve group in sub-files | drwxrwsr-x |
| Sticky bit (1000) | Restrict deletion to owners | drwxrwxrwt |
chmod g+s shared_dir
chmod +t public_dir
7. User Identity Control: su vs sudo
- su: switches user, prompts for target user’s password
- sudo: executes with elevated privileges, using current password and
/etc/sudoersconfig
sudo backup_script
Note: Ubuntu disables root account by default, preferring sudo access.
8. Changing Ownership
sudo chown tony: file.txt # Change user to tony
sudo chgrp music file.mp3 # Change group to 'music'9. Setting Up a Shared Directory
- Create group
music - Add users (e.g., bill and karen) to group
- Create shared directory
/usr/local/share/Music - Assign ownership and permissions:
sudo chown :music /usr/local/share/Music
sudo chmod 775 /usr/local/share/Music
sudo chmod g+s /usr/local/share/Music
Ensure umask 0002 to allow group write access.
10. Managing Passwords
passwd # Change current user password
sudo passwd username # Change another user's password
Changes are stored in /etc/shadow and follow system policies.
Conclusion
Unix’s permission system enables reliable multiuser environments. With tools like chmod, umask, sudo, chown, and passwd, administrators and users can customize access and ownership for secure resource sharing.
Written & researched by Dr. Shahin Siami