If you are webmaster managing your own website on a Linux Server ,You must have faced this error message \u00a0\u201cYou do not have permission to upload or create files here" . After some googling, the solution is "CHMOD to 777" or CHMOD to 775" . You might be wondering what \u00a0\u201c777\u201d mean? And why must it be \u20187\u2019, and why not \u20188\u2019 or \u20189\u2019?\nWhat is CHMOD\nOn Linux, there is a set of rules for each file which defines who can access a particular file and how they can access it. These rules are known as "File Permissions" or "File Modes". The word\u00a0CHMOD\u00a0stands for "Change Mode". Its a syntax with which users can change file permissions which i will explain below.\nCHMOD File Permissions\nLinux \/ Unix come with a file control mechanism to allow who can access a particular file or folder and what actions that user can perform. There are two parts to the file control mechanism :\u00a0Classes and Permissions. Classes\u00a0tell who can access the file while the Permissions determine the kind of action the user can perform on the said file.\n\nThere are three type of Classes \u2013 Owner, Group, Others.\n\n \tOwner is the creator of the files\/folders. In Linux, files or folders that you created \u00a0owned by you, unless you specifically change the ownership.\n \tGroup contains a group of users who share the same permissions and user privilege, these are generally the server roles aswell\n \tOthers means the public.\n\n\n\nPermissions are also of three types \u2013 Read , Write , Execute.\n\n \tRead \u2013 Only view files but cannot modify the content of the file. When this is applied on a Folder, you can only view the files inside the folder\u00a0but can\u2019t delete or add files into the folder.\n \tWrite \u2013 Can edit and modify the file. For Folders you can delete and add files into the folder.\n \tExecute \u2013 Execute is mainly used when you need to run the file (commonly used when you need to run a script). Mostly required with Upload scripts etc\n\n\n\nWith Classes and Permissions combined we are able to control who can access the file and what actions they can perform on those files \/ folders\nWhat is CHMOD 777\nlets talk about "777", "775" \u00a0and what this means as now you must be clear about the Classes and Permissions.\n\nEvery file and folder contain a 8-bit data that control the permissions. At its basic binary form, it will be \u201c000\u201d, which means no permissions of any form is granted. When you set a \u201cRead\u201d permission, it will add 4-bit to the data, making it \u201c100\u201d (in binary format) or a \u201c4\u201d in the usual decimal format. Applying a \u201cWrite\u201d permission will add 2-bit to the data, making it \u201c010\u201d and \u201c2\u201d in decimal form. Lastly, setting an \u201cExecute\u201d permission adds 1-bit to the data, which will result in \u201c001\u201d, or \u201c1\u201d in decimal form. When we sum it up :\n\n \tRead is equivalent to \u20184\u2019.\n \tWrite is equivalent to \u20182\u2019.\n \tExecute is equivalent to \u20181\u2019\n\nLets set some Permissions by adding up the numbers. For instance, to set the permissions to read and write, we will use \u20186\u2019 (4 + 2) for the permission. For read, write and execute, we will use \u20187\u2019 (4 + 2 + 1) for the permission. Here\u2019s the detailed breakdown:\n\n\n\n0 \u2013 no permission\n1 \u2013 execute\n2 \u2013 write\n3 \u2013 write and execute\n4 \u2013 read\n5 \u2013 read and execute\n6 \u2013 read and write\n7 \u2013 read, write, and execute\n\nYou set the number as per the permissions you want to allocate a file or folder.\n\nSo What about three digits i.e. 777 ?\u00a0First digit is assigned to the Owner, Second digit is assigned to the Group and third digit is assigned to the Others. So for a file with \u2018777\u2019 permission, everyone can read, write and execute the file.\u00a0Some commonly used CHMOD permissions in Linux :\n\n \t755 \u2013 This permission is mostly\u00a0used in web server.\u00a0Owner has all the permissions to read, write and execute. Everyone else can only read and execute, but cannot write\u00a0to the file (make changes).\n \t777 \u2013 Everyone can read write and execute. It is not advisable to set \u2018777\u2019 permission in a web server for your files and folders as it allows anyone to add bad\u00a0code to your server (Hackers love such misconfigured permissions). However, in some cases, you will need to set the 777 permissions before you can upload any file to the server (For example, uploading images in your website)\n \t644 \u2013 Only the owner can read and write. Everyone else can only read. No one can execute the file.\n \t655 \u2013 Only the owner can read and write, but not execute the file. Everyone else can read and execute, but cannot modify the file.\n\nHow to CHMOD permissions in Linux\nYou can easily change the file permissions in Linux by just right-clicking the file or folder and select \u201cProperties\u201d. There will be a Permission tab where you can change the file permissions. You might not get a desktop interface if you have hosting , but you can achieve the same in your Hosting File Manager. You can also set permissions using a terminal, Command to use to change file permission is "chmod". Basically setting a\u00a0\u201cchmod 777\u201d means making the file readable, writable and executable by everyone.\nchmod 777 \/path\/to\/your\/file\nHopefully after reading all this you have a better understanding about CHMOD and what CHMOD 777 is and how they work in Linux environment.