Fixing Removed FTP Read Permissions

The FTP protocol includes a command called “CHMOD” that allows you to change the “permissions” of your files.

It’s possible to use this command to remove all “read permissions” from your files using something like CHMOD 311 filename. However, doing that will make it impossible even for you to access your own files, so you should not do this intentionally.

If you do accidentally remove “read permissions” from your files or folders using FTP, you may need to use the shell to fix it. (You won’t be able to fix it using FTP, because the FTP server needs to be able to read a file to modify anything about it.)

Fixing the problem from the shell

If you’re familiar with the command-line shell, you can restore all permissions to the standard ones by running these two commands from your Web directory:

find -type d ! -perm -700 -print -exec chmod 0755 {} \;
find -type f ! -perm -600 -print -exec chmod 0644 {} \;

Note that this resets the permissions on all directories and files that do not have read and write permission. It may not be appropriate if you’re a technically advanced user who has intentionally set non-standard permissions on some files.

If you’re unable to do this yourself, we can do it for you within one business day if you contact us.