CHMOD what is this ?

Noor

Administrator
Staff member
CHMOD - Setting permissions on files and folders
Access rights are attributes of a file or directory that tell the server who can do what with the corresponding file or directory.
Typically, access rights regulate actions such as reading, writing to a file (or directory), and execution. Our servers are based on a UNIX system, so we will look at setting access rights specifically for them.
On UNIX systems, all users are divided into three groups: "user" (the file owner), "group" (a member of the same group as the file owner), and "world" (everyone else).
When you connect to the server, it determines which group you belong to. For example, when connecting to a server via FTP, you log in under your username, and accordingly the server assigns you to the “user” group. Other users connecting via FTP will be assigned to the “group” group, and when a person gets to your site through their browser, they get into the “group” group, and when a person gets to your site through their browser, they get into group "world". After defining a group, the user receives rights to perform actions on objects.
That is, it can read, write or execute a file. To view a directory, it must be executable; to view its contents, it must have the read attribute, and to create a new file or directory in an existing directory, it must have write permission.
Thus, in order for an application or CGI script to be executed, it is necessary to set the read and execute attribute to the directory. To assign rights to the corresponding groups, numeric notations are used:
4 = read (read right)
2 = write (write right)
1 = execute (execute right)
The first digit in the notation sets the rights for the "user" group (i.e. actually for you), the second for the group "group" and the third for "world". By simply adding numbers, you can establish rights to a set of actions.
For example, 3(2+1) allows writing and executing a file (directory); 5(4+1) allows reading and execution;
6(4+2) allows reading and writing;
7(4+2+1) establishes read, write and execute rights.
That is, there are only seven options:
7 = read, write & execute
6 = read & write
5 = read & execute
4 = read
3 = write & execute
2 = write
1 = execute
To set access rights, use the CHMOD command. Despite this, it never hurt anyone to know a little more about UNIX commands. So, the "chmod" command has two modes: Absolute (numeric) and Character mode. The "chmod" command used in Unix, or the "site chmod" command,used in some FTP managers (eg FTP Explorer), can be used in both modes.
In Absolute (digital) mode, the 3-digit access rights code described above is used. Character mode uses a literal format to set permissions.
Here the letters
"r", "w" and "x" are used for read, write and execute respectively.
And also "u", "g", "o" and "a" for user, group, other (world), and all (all [not used]) respectively.
For example: 755 = chmod u=rwx,go=rx filename;
644 = chmod u=rw,go=r filename;
600 = chmod u=rw,go= filename;
444 = chmod a=r filename.
Here are some of the most common combinations: Access rights - Command (code) - Description UGW rwxr - xr - x [site]
chmod 755 For directories, CGI, PHP scripts rw - r - - r - - [site] chmod 644
For regular files rw - - - - - - - [site] chmod 600 Hide files from everyone except your scripts
U = user; G = group; W = world r = Read; w = Write; x = Execute; - = No right
All modern FTP clients have the ability to assign access rights by checking the checkboxes, or simply by entering a digital code in the appropriate field.

FAR
Open FAR, go via FTP, select a file or folder, press Ctrl+A Set the necessary rights.

Total Comander
Open Total Comander, go via FTP, select the file, then Files and Change attributes Set the necessary rights

FileZilla
Open FileZilla, go via FTP, select the file, and then right-click - Change attributes Set the necessary rights
 
Back
Top