File permissions
Definition
File permissions are rules enforced by an operating system that control which users can read, write or execute a file or access a directory. On Unix-like systems permissions are typically expressed as three permission sets (owner, group, others) with three bits each (read, write, execute). Other systems (for example Windows) use access control lists (ACLs) that offer finer-grained control.
Why it matters
Permissions protect data and system integrity. Correct permissions prevent unauthorised access, accidental modification or deletion, and help ensure that scripts and services run only when they should. Misconfigured permissions are a common source of bugs, security breaches and failed deployments.
Example in VCA
Create a projects folder and set restrictive access for your user:
mkdir ~/vibe-projects chmod 700 ~/vibe-projects
- mkdir creates the directory.
- chmod 700 sets permissions so only the directory owner can read, write and enter it (7 = read+write+execute for owner; 0 for group and others).
If you want your project visible to others but still secure, use 755 for directories and 644 for files inside:
chmod 755 ~/vibe-projects # owner rwx, group r-x, others r-x chmod 644 ~/vibe-projects/readme.md # owner rw-, group r--, others r--
Make a script executable so it can be run:
chmod +x deploy.sh
These commands are common in coursework and deployment exercises where files must be accessible to build tools or hidden from other users.
Another Real World Example
Hosting a website: static files (HTML, CSS, JS) often use 644 so the web server can read files but not modify them; directories use 755 so the server can traverse them. For CGI or other executable scripts, the execute bit must be set. On shared systems the sticky bit or ACLs are used to allow many users to create files in a common directory without being able to remove each other’s files.
Common mistakes
- Using 777 (read/write/execute for everyone) out of convenience — it exposes files to unwanted modification and execution.
- Forgetting the execute bit on directories: without it you cannot cd into or list the directory contents even if read is set.
- Confusing ownership and permissions: chmod changes permissions, chown changes the owner/group.
- Applying chmod -R without checking — it can make sensitive files world-readable or executable.
- Misreading numeric notation (e.g. 644 vs 664) and what each digit controls.
- Expecting chmod to override ACLs or mount-level restrictions — extra layers (ACLs, SELinux, Windows ACLs) may still deny access.
Related terms
- chmod
- chown
- umask
- ACL
- rwx
- execute bit
- sticky bit
- POSIX permissions
- file system