chmod is a command line utility under UNIX or UNIX like OS Linux. Although chmod classically requires shell access to change permission, sFTP can be used too. chmod was used first by AT & T on UNIX system since early 1970s. chmod changes the attribute of the file of the owner or the root user.
There are options available for chmod (under shell) ; options can be -v for verbose output and -R for recursively through all the subdirectories. chmod allows a short form for permissions.
There are r , w , x , s and t modes corresponding to the classical symbolic notation. In addition, there is the special character X (capital x), which uses only the file execution law those already have a set right at least one user class.
Numerical permissions of chmod is mostly used as they are easier to remember. 7 gives full permission where as 4 is read only permission.
Practical examples and explanation of chmod
Running this command from shell for a file named example.php :
$ chmod u = rw, g-rx, o + r example.php
sets the permissions of the file example.php of the adds to all others the right to read. Under graphical interface using any sFTP client like WinSCP, simple right click under Windows as remote computer can change the permission of any file on your server :
chmod has special importance for cms like WordPress where there are the data is stored on MySQL database and WordPress software acts as the owner. You can see the WordPress Codex for reference of chmod for WordPress. It is not only a good article for WordPress, it is good for understanding chmod itself.
It is quite dangerous to set chmod to 777 unless there is special need. By default WordPress sets chmod to 755 ; sometimes shared and advanced Cloud Hosting platforms do not allow to execute a file by WordPress for maintaining safety. Temporary changing the chmod to 777 solves the problem. Never forget to revert it back.