How to check file permissions (CHMOD) & fix unsafe files Print

  • 0

Overview

Incorrect file permissions can make your website vulnerable to attacks. This guide explains the recommended permission settings for secure hosting.

Recommended CHMOD permissions

Files: 644  
Folders: 755  
Sensitive files (wp-config.php): 600

How to check permissions in DirectAdmin

  1. Go to File Manager
  2. Select any file or folder
  3. Click Permissions
  4. Adjust the CHMOD values

Common insecure permissions

  • 777 — extremely unsafe, avoid at all costs
  • 666 — writable by everyone
  • 775 — acceptable only for specific server environments

Fix permission issues quickly

If your site was compromised or behaves strangely, reset permissions via SSH:

find ~/domains/yourdomain.com/public_html -type d -exec chmod 755 {} \;
find ~/domains/yourdomain.com/public_html -type f -exec chmod 644 {} \;
chmod 600 ~/domains/yourdomain.com/public_html/wp-config.php

Tips

  • Never give write access to “others”
  • Change permissions before installing plugins/themes
  • For WordPress uploads, ensure wp-content/uploads is 755

Was this answer helpful?

« Back