New batchZero to DevOps starts 29 Nov · limited seatsReserve your seat
Cheat sheetsLinuxLinux
ProSheet 05 of 7

Permissions & Ownership

A comprehensive developer cheatsheet covering Linux file permissions and ownership, featuring essential CLI commands, numeric and symbolic modes, and operational workflows for managing access control (chmod, chown, chgrp), configuring default permissions (umask), and enforcing advanced security via Access Control Lists (ACLs) and special file attributes (chattr).

Understanding Linux Permissions

Permission Structure

Every file and directory has 3 sets of permissions for 3 user categories:

CategorySymbolMeaning
User (u)OwnerThe user who owns the file
Group (g)GroupUsers in the file's group
Others (o)WorldEveryone else

Permission Types

SymbolPermissionNumeric ValueMeaning
rRead4View file contents / List directory
wWrite2Modify file / Create/delete files in directory
xExecute1Run file as program / Enter directory
-No permission0Access denied

Numeric (Octal) Permission System

bash
$ ls -l file.txt
-rw-r--r-- 1 bob staff 1234 Jan 15 10:30 file.txt
#  ^^^^^^^^
#  ││││││││
#  │││││││└─ Others: r-- (read only) = 4
#  ││││││└── Group: r-- (read only) = 4
#  │││││└─── User: rw- (read/write) = 6
#  ││││└──── Type: - (regular file)
#  │││└───── Special: none

Common Permission Sets:

NumericSymbolicMeaning
755rwxr-xr-xOwner: full access, Group/Others: read & execute
644rw-r--r--Owner: read/write, Group/Others: read only
700rwx------Owner: full access, Others: no access
600rw-------Owner: read/write, Others: no access
777rwxrwxrwxEveryone: full access ( INSECURE)
750rwxr-x---Owner: full, Group: read/execute, Others: none

Special Permissions

SymbolNameNumericEffect on FilesEffect on Directories
The rest of this sheet is locked4 Pro sheets unlock together, across every toolEveryPro sheet, every toolLifetimeone payment, no renewalNewsheets included as they shipOne-time payment · lifetime access