
chmod Cheat Sheet: Linux File Permissions in 5 Minutes
If you've ever SSH'd into a server and run chmod 777 just to make things work... this post is for you. Let's fix that. Linux file permissions are simpler than they look. Once you understand the three-digit number, you'll never have to Google "chmod 755 vs 644" again. The Permission Model in 60 Seconds Every file has three permission categories: Owner (u) -- the user who created it Group (g) -- users in the file's group Others (o) -- everyone else Each category gets three permission types: Read (r) = 4 Write (w) = 2 Execute (x) = 1 Add them up for each category. That's your chmod number. -rwxr-xr-- deploy.sh ||| ||| || ||| ||| |+-- Others: r-- (4) ||| ||+----- Group: r-x (5) ||+---------- Owner: rwx (7) chmod 754 deploy.sh The Octal Cheat Sheet Value Symbolic Meaning 0 --- No permissions 1 --x Execute only 2 -w- Write only 3 -wx Write + execute 4 r-- Read only 5 r-x Read + execute 6 rw- Read + write 7 rwx Full access The Permissions You'll Actually Use chmod Who gets what When to use it
Continue reading on Dev.to DevOps
Opens in a new tab
