Changing file/folder permissions

Folders and files in Linux and other UNIX servers have access permissions. These access permissions are read by the operating system when someone request to access a file or folder. If the requesting user does not have enough access rights granted (counter checking with the permission set for the requested folder or file), the request to the file or folder will be rejected. There are three types of access rights offered by the *nix system:

  • Read - Marked as r, files or folders with read access can be shown to the requesting user.

  • Write - Marked as w, users can modify the folders or files with write access permission set.

  • Execute - Marked as x, files or folders marked with execute access permission allow the files to be executed as programs, note that folders are usually marked with execute access right.

Users are categoried into three different access types :

  • User - owner of the folder or file.

  • Group - other users or members belonging to this group.

  • World - Everyone and anyone else.

The web hosting server needs to have enough acess rights granted to read all the web page hosting in your account in order to serve them to your website visitors, following are general guideline on file and folder permissions to be set for your website, note that these permissions has to be set properly otherwise your website may not be function correctly.

  • HTML pages and images used in the web pages must be readable by all (i.e. owner,group and world). The permissions for this is 644 'rw-r--r--' (User can read and write, Group can read, and World can read), this is default permission set for all files when it is first uploaded to the server.

  • Folders need to have executable rights set for all. The setting is 755 'rwxr-xr-x' (User has full rights, Group can read and execute, and World can read and execute), this is default permission for newly create folders.

  • CGI files (i.e script.pl, script.cgi) must be set executable. The setting is similar to folder setting 755 'rwxr-xr-x' (User has full rights, Group can read and execute, World can read and execute), please take note this permission is not set automatically when you upload file, you will have to change them manually. Please refer to the Introduction to CGI for more details.

NOTE: It is important to disallow everyone to have full access to your files or folders, with a write permission granted, anyone can delete or modify files and folders in your account and that can be a serious security issue. Therefore, it is important that you understand the concept and apply only needed permissions on files and folders and not simply open up everything to anyone.

To change file or folder permissions:

  1. Move to the file or folder you wish to change permissions.

  2. Click the file name or folder name.

  3. Click Change Permissions link at top right corner of screen.

  4. Check the apporpriate permission tick boxes.

  5. Click Change button to save this new permission.

Click to display image