Skip to main content

Permission Symbolic Codes

Linux Symbolic Permission Codes

Symbolic permission codes let you modify file & directory permissions using readable expressions (u, g, o, a + + - = rwx). This is the most precise and safest method during WordPress server operations especially when editing specific access without breaking the whole structure.

What You Will Learn

  • What symbolic permissions are and how they differ from numeric mode.
  • Permission entities (u/g/o/a) what each controls.
  • Permission operators (+, , =) and when to use them.
  • Practical web-server and WordPress examples.
  • Mistake prevention (avoid accidental chmod -R issues).
  • Verification commands.
  • Real lab + cheat sheet + mini-quiz.

5W + 1H Framework

QuestionAnswer
WhatSymbolic chmod using letters instead of digits
WhyFine-tune permissions without resetting all bits
WhereLinux filesystem, wp-content, config files, shell scripts
WhenSecurity hardening, patch access, PHP logs, CLI tasks
Whoroot admin, dev user, www-data/lsadm group
Howchmod u+r, chmod g-w, chmod o=rx, etc.

Roles (Entities)

EntityMeaningTypical WP Use
uuser (owner)WordPress system user
ggroupwww-data or lsadm
ootherspublic / web visitors
aall (u+g+o)quick apply across all

Permission Bits

SymbolMeaning
rread
wwrite
xexecute (or enter directory)

Operators

OperatorMeaningExample
+add permissionchmod g+w file
-remove permissionchmod o-x file
=set exact permissionschmod u=rwx,g=rx,o= file

Key Difference vs Numeric Mode

MethodExampleUse Case
Numericchmod 755apply base perms site-wide
Symbolicchmod g+w uploadsmodify one permission safely

Numeric replaces everything; symbolic changes only whats specified.

Syntax Formula

chmod [WHO][OPERATOR][PERMISSION] file

Examples:

chmod u+r file
chmod g-w file
chmod o= file
chmod a+rx script.sh

Practical WordPress Examples

Add write to group for uploads folder (multi-user dev stack):

chmod g+w wp-content/uploads

Remove write access from public (hardening):

chmod o-w wp-config.php

Add execute only for owner on deployment script:

chmod u+x deploy.sh

Lock down config to owner only:

chmod go-rwx wp-config.php

Equivalent to numeric 600.

Expected Output

Command:

ls -l wp-config.php

Output:

-rw------- 1 www-data www-data wp-config.php

Special Flags in Symbolic

FlagMeaningUsage
Xonly add execute to directorieschmod -R a+X project/
ssetuid/setgidadvanced case
tsticky/tmp

Example safe directory fix:

chmod -R a+rX /var/www/site/

Static vs Dynamic Framing

ModeUse
Static patternnumeric 644/755 baseline
Dynamic symbolic patchingpermission tuning on-the-fly

Go-Live Checklist

ActionCommand
Remove public writechmod o-w file
Add directory traversalchmod a+X dir/
Secure wp-configchmod go-rwx wp-config.php
Verifyls -l

Troubleshooting Matrix

IssueCauseFix
Lockout editing themeremoved owner writechmod u+w wp-content/themes
Public script execothers have xchmod o-x file.sh
Uploads forbiddenmissing directory xchmod a+X wp-content/uploads

Quick Lab

**Objective: Secure wp-config and allow uploads behavior

cd /var/www/your-site/public_html

chmod go-rwx wp-config.php
chmod g+w wp-content/uploads
chmod a+X wp-content/uploads

ls -l wp-config.php
ls -ld wp-content/uploads

Verify:

  • wp-config only owner access
  • uploads folder writable by service user group

Cheat Sheet

u = user
g = group
o = others
a = all

+ add
- remove
= assign

r read
w write
x execute
X directory execute

Common:

chmod o-r file
chmod g+w dir
chmod u+x script.sh
chmod go-rwx wp-config.php
chmod a+X -R wp-content

Mini-Quiz

Command to remove other write?

chmod o-w file

Command to allow owner execute only?

chmod u+x script.sh

Which operator overwrites all bits?

=

Secure wp-config with symbolic mode?

chmod go-rwx wp-config.php