Changing File Permissions

On computer filesystems, different files and directories have permissions that specify who and what can read, write, modify and access them.  Often, server-side applications need to be able to edit, read, write and even delete files on your behalf.  When the permission settings don’t allow for that, weird things happen.  Here’s how to change file permissions using an FTP client.

Our favorite FTP client is FileZilla.  It’s fast, free and really good at setting permissions.

Permission Modes

Without getting too technical, the permission mode is computed by adding up the following values for the user, the file group, and for everyone else.  7 is wide-open.  0 or 1 is very narrow.

Example Permission Modes

Mode Str Perms Explanation
0477 -r–rwxrwx owner has read only (4), other and group has rwx (7)
0677 -rw-rwxrwx owner has rw only(6), other and group has rwx (7)
0444 -r–r–r– all have read only (4)
0666 -rw-rw-rw- all have rw only (6)
0400 -r——– owner has read only(4), group and others have no permission(0)
0600 -rw——- owner has rw only, group and others have no permission
0470 -r–rwx— owner has read only, group has rwx, others have no permission
0407 -r—–rwx owner has read only, other has rwx, group has no permission
0670 -rw-rwx— owner has rw only, group has rwx, others have no permission
0607 -rw—-rwx owner has rw only, group has no permission and others have rwx

Using an FTP Client

FTP programs (“clients”) allow you to set permissions for files and directories on your remote host. This function is often called chmod or set permissions in the program menu.

Here’s how you change the permission of a file called “index.php”, but the process is the same for any file or folder.

Connect to your site using FileZilla. In the remote site side of the screen, right-click on ‘index.php’ and select ‘File Permissions’. A popup screen will appear.

You can check the boxes to set the permission or just enter the permission mode number toward the bottom. The most common permission modes are: “755” and “644”.

If you’re wanting to change the permissions of a LOT of files and/or folders, usse the “recurese into subdirectories” and select from “Files,” “Folders,” or “Files and Folders.”

podz_filezilla_13