Skip to main content

1755

Sticky Bit + 755

1755 combines:

  • Sticky bit (1): Only file owner/root can delete in the directory
  • Standard **755 permissions:
  • Owner rwx
  • Group r-x
  • Others r-x

Result: directory or file executable for everyone, but **deletion inside is restricted if directory sticky-enabled.

Used mainly for **shared writable directories rarely needed in typical WordPress setups.

Objective​

Understand 1755 behavior, safe usage guidelines, and when to avoid it in WordPress environments.

Concept Breakdown​

Octal structure​

DigitMeaning
1Sticky bit
7Owner rwx
5Group r-x
5Others r-x

Effects​

ContextBehavior
DirectoryUsers cannot delete others' files
FileSticky bit mostly irrelevant on files

Syntax Formula​

Set sticky + 755​

chmod 1755 <directory>

Remove sticky bit​

chmod -t <directory>

Permission Indicator​

In ls -ld:

drwxr-xr-t

t on **others execute position indicates sticky bit.

Practical Example with Output​

Create shared directory w/ sticky bit​

mkdir /srv/shared-cache
chmod 1755 /srv/shared-cache
ls -ld /srv/shared-cache

Expected:

drwxr-xr-t ... /srv/shared-cache

WordPress-Relevant Usage​

ScenarioValidNotes
PHP /tmp directory✅ OS defaults handle this
Shared developer scratch dir✅ If controlled access
WP uploads directory❌ Never
WP cache directory❌ Avoid
Public HTTP directories❌ Attack surface

Practical WP Server Scenarios​

CaseGuidance
Shared /srv/teamzone for devopsAllowed w/ ACLs
PHP temp/session locationsKernel default only
wp-content treeMust avoid
/tmp for appsUsually managed by system — do not override

Security Considerations​

Risks​

RiskReason
Used in web directoriesAttackers can place files + persistence
Misunderstanding stickyDoesn’t prevent read/write abuse
Shared hosting behaviorWP security model breaks

Audit​

find / -perm -1000 2>/dev/null

Remove​

chmod -t <path>

Best Practices​

RuleReason
Use sticky only on shared dirsProtect cross-user deletes
Never on WordPress data dirsUpload path risk
Prefer ACLs & sudo policiesGranular control
Let OS handle /tmp permsSecure defaults

WordPress Audit Commands​

Scan WP tree:

find /home -type d -perm -1000

Expected result: blank

Found?

chmod -t <dir>

Go-Live Checklist​

Item✅
Sticky only on intended directories✅
No sticky under /home/*/public_html✅
ACLs enforced for team dirs✅
No sticky override for /tmp✅
Weekly check configured✅

Troubleshooting Matrix​

ProblemCauseFix
Cannot delete files in dirSticky bit setchmod -t
WP scans warn about permsSticky bit misusedRemove + reset perms
Web user persistence riskSticky on web dirsRemove + isolate

Quick Lab​

Create safe sticky directory for dev team:

groupadd wpdev
mkdir /srv/wpdev-tmp
chgrp wpdev /srv/wpdev-tmp
chmod 1775 /srv/wpdev-tmp
ls -ld /srv/wpdev-tmp

Expected:

drwxrwxr-t ... /srv/wpdev-tmp

Cheat Sheet​

CommandDescription
chmod 1755Sticky + 755
chmod -tRemove sticky
find / -perm -1000Audit sticky dirs
ls -ldCheck t bit

Mini Quiz​

QuestionAnswer
What does 1 in 1755 do?Sticky bit
Safe for wp-content?No
Indicator in ls?t on other execute bit
Primary purpose?Prevent cross-user deletion