Using the command chmod, you can set your file permissions.
Permissions protect your data towards users (including yourself) working on the same system.
What kind of permission a certain folder or file has, can be verified using the command ls -al.
For example, this command could generate the following output:
-rwxrw-r-- 1 jjanssen fland 65754 Oct 20 14:12 info.html
The first column shows the permissions. This column contains 3 sections of information.
Mind that the first character mentions whether we are talking about a file (-) or directory (d) here.
This first character is not counted in one of these blocks.
Next to the first sign three blocks of three characters each are shown. The value of each character can be
r (read), w (write), x (execute) or - (function not present).
The first block of 3 characters stands for the owner of the file or directory,
the second for the group the owner belongs to and the third for all others on the system.
Looking at the example above we can see: the user jjanssen has access to write, read and execute;
all users of the group fland have read and write access, but no permisssion to execute the file; all other users can only read.
Changes to the permissions of a file or directory can be made by using the command chmod in the form of
chmod argument file_or_folder_name.
This argument requires some explaining.
It always exists of 3 digits that display the permissions for the owner (yourself), the group and the others (in that order).
The system can interpret this argument because every kind of permission (read, write or execute) corresponds to a predetermined value.
The system extrapolates the desired permissions from the argument by considering them as the sum of the values. The values are:
read permission: 4
write permission: 2
execute permission: 1
Knowing these values we can extrapolate 8 different permissions applicable to the owner, group and others:
|1||--x||only execute access|
|2||-w-||only write access|
|3||-wx||write and execute access|
|4||r--||only read access|
|5||r-x||read and execute access|
|6||rw-||read and write access|
|7||rwx||read, write and execute access(full access)|
More info on the use of the command chmod can be found in the specific manual page on Unix level by means of the command:
$ man chmod
Windows users can also use WinSCP to modify permissions.