Skip to main content

400

400 Permission Code**

Permission Code: 400 Owner Read-Only (Lockdown Mode)

400 grants **read-only access to the **owner and **no access to group or others.

r--------

This mode is highly restrictive and typically used to lock critical files from any modifications, even by accident. In WordPress VPS environments, it is used for **temporary hardening or immutable protection during maintenance or audits.

Technical Structure​

NoRoleBitsAccessAllowed?
1Ownerr--read only✅
2Group---no access✅
3Others---no access✅

Behavior​

  • Owner can read the file contents
  • Owner cannot write/edit
  • Group and others cannot read or modify
  • File becomes effectively locked
  • Must be changed back before editing

WordPress Use Cases​

NoFile / LocationSuitabilityReason
1wp-config.php (temporary lock)✅protect during audit/incident
2Deployment “freeze” files✅prevent accidental editing
3Emergency response situations✅freeze config during breach
4Permanent config lock❌difficult to maintain
5Any WP theme/plugin files❌editing impossible

400 is often used as a temporary security state, not a long-term default.

Typical Workflow Scenarios​

Scenario: Post-deployment hardening​

Temporarily prevent config edits after pushing live changes:

chmod 400 wp-config.php

Scenario: Forensic freeze during suspected compromise​

chmod 400 wp-config.php

Then investigate without config tampering risk.

After finishing, restore to 600 or 640.

chmod 600 wp-config.php

Comparison With Other Secure Modes​

NoModeOwnerGroupOthersUse
1600rw-------standard secure config
2640rw-r-----shared access group
3400r--------read-only lockdown

600 is normal security

400 is lockdown

Commands​

Apply Lock​

chmod 400 wp-config.php

Revert after maintenance​

chmod 600 wp-config.php

Or hardened group-aware:

chmod 640 wp-config.php

Ownership Requirements​

Owner must be correct user:

chown wpuser:www-data wp-config.php

If ownership is wrong, even the admin might be blocked from modifying file.

Troubleshooting​

NoSymptomCauseFix
1Cannot update WP configfile is locked read-onlychmod 600 wp-config.php
2Cannot modify env keyslockedrevert permissions
3CLI scripts fail to adjust configread-onlytemporary lift
4Site breaks on some stacksserver user needs readensure correct owner/group

Verification​

stat wp-config.php

Expected:

Access: (0400/-r--------)

Exercise​

  1. Lock config

    chmod 400 wp-config.php

  2. Attempt config modification (should fail)

  3. Attempt WP CLI with wrong user (fail)

  4. Restore edit state

    chmod 600 wp-config.php

Key Takeaways​

NoStatementStatus
1400 is read-only for owner✅
2Used for temporary config lockdown✅
3Must revert before editing✅
4Not for general WP files✅
5Works in breach response/maintenance mode✅

Summary:

Use 400 to temporarily lock critical config files from modification.
Return to 600 or 640 when editing is needed.