How do I set "access permissions" for a file or folder on my web server?

The methods you can use to set access permissions depend on whether you have terminal, Telnet, SSH, FTP or SFTP access to your server, and whether your web host offers a control panel or file manager.

Using FTP or SFTP


Using an FTP client

Notice the octal number, 755, at the bottom. The first digit is for the owner, or "User", of the file or folder; the second is for the group (the only member of which is often the owner); and the third digit is for everyone else with access to the server, or "World". Each digit is the total of 4 for read access, 2 for write access, and 1 for execute access, for example, 7 for full access, 5 for read and execute only, 6 for read and write only, 4 for read only, etc.
Donald Trump 'I'm With Stupid' T-Shirt
If you can connect to your server using an FTP or SFTP client, you may be able to use it to set access permissions. This is probably the easiest method, but there are two requirements for it to work: To set access permissions using FTP or SFTP:
  1. Log in to your server using your (S)FTP client.
  2. Locate and select the file or folder whose access permissions you wish to set.
  3. Find the feature in your (S)FTP for setting access permissions. This may be a menu item named "Access Permissions" or something similar, or it may be less obvious--for example, a menu item named "Get info" or "Properties". Each (S)FTP client is different, and some do not support this feature at all.
  4. Select the desired access permissions and click "Apply", "OK", or do whatever is appropriate to apply the new settings.

Using Telnet, SSH, or a terminal connected directly to the server

If you can connect to your server using a Telnet or SSH client, or have access to a terminal connected directly to your server, and your server is running UNIX or a UNIX-like operating system (Linux, BSD, etc.), then you can set access permissions using the "chmod" command. If you have access to a terminal connected directly to a Windows-based server, you can use Windows Explorer to set access permissions.

Using chmod

To use the chmod command:
  1. Log in to your server using a Telnet or SSH client, or at a terminal connected directly to the server.
  2. Unless you already know the full path to the file or folder whose access permissions you wish to set, locate it. (Instructions for how to do that may be added here later).
  3. Type "chmod [permissions] [path to file or folder]", changing "[permissions]" to the appropriate number (see note below), and "[path to file or folder]" to the full path to the file or folder whose access permissions you with to set, or the relative path to it from where you are, and press the return key. For example, to give the owner of "/home/myusername/data/clients.txt" read and write access, and no access to anyone else, type "chmod 600 /home/myusername/data/clients.txt" (without the quote marks) and press the return key.
* NOTE: To determine the appropriate number for the access permissions, see the explanation below the screen shot for setting access permissions using an FTP client.

Using Windows Explorer

To use Windows Explorer (not Internet Explorer) to set access permissions using a terminal connected directly to the server:
  1. Log in to the server.
  2. Launch Explorer.
  3. Locate the file or folder whose access permissions you wish to set.
  4. Click it with the right mouse button to bring up the contextual menu.
  5. Select "Properties" from the contextual menu.
  6. Find the permissions settings, and set them as desired. You may need to click a tab, such as the "Security" tab, to find the settings.
  7. Click "OK" or "Apply".
  8. To enable the appropriate level of access for web browsers, you may also need to set access permissions in your web server software. (Explanation of how to do that may be added here later.)

Using your web host's control panel or file manager

Some, but not all control panels and file managers provided by web hosts enable you to set access permissions for your files and folders. The details of how to do it vary widely from system to system, but generally speaking, you will do something like this:
  1. Log in to your web host's control panel or file manager.
  2. Locate the file or folder whose access permissions you wish to set.
  3. Find the control for bringing up the screen for setting access permissions. It may be a button or icon on the same line as the file or folder name, or you may need to check a checkbox on the same line as the file or folder name and then find a button at the top of bottom of the list of files.
  4. Once you've brought up the screen for setting access permissions, set them as desired and click "OK" or whatever the button is labeled that applies the settings.