ComputersInformation Technology

How to set permissions for 777 on Linux?

The operating system is an integral part of any computer. Recently, the Linux OS has been very popular with a variety of Linux variants, thanks to the free distribution and inheritance from Unix of the principle of sharing rights for the user.

An integral part of any system are files. After all, all the user information is stored in them. Access rights to files and folders determine what actions are allowed to perform a particular person, thereby setting access levels and ensuring the security of the entire system. Typically, setting access rights is to enable or disable execution, reading, and writing.

Users and Groups

For each user, the operating system assigns its unique identifier. In "Linux" it is called UID. In addition, for ease of administration, users are grouped together, which are also assigned a unique GID number.

All users "Linux" divides into three groups:

  • User - the owner of the file;
  • Group is a member of the same group as the owner;
  • Other - all others.

When accessing a file, the operating system determines whether the user belongs to certain groups. For example, a client who sends a request to a site through a browser will be referred to the other. In case the site owner connected via FTP with the user name and password, it will be assigned to the user group.

Access rights

Groups have individual rights governing the ability to perform operations with files such as reading, launching or changing. For each of them, there are three types of access:

  • To start;
  • For reading;
  • To write or edit.

Numerical mode of indication of rights

It is often enough to indicate the right to change, start or read for each group using a numerical designation. The following parameters are used:

  • 4 - reading;
  • 2 - record;
  • 1 - execution.

In the designation of access rights, as a rule, only three digits are used. The first one specifies the rules for the user-owner, the second for the group, and the third for all others. To assign certain rights to each group, one resorts to a simple addition of numbers. For example, 7 indicates the possibility of execution, writing and reading, and 6 allows only to change and read the file. Thus, the permissions of access 777 Linux as a rule, which allows you to run, read and rewrite the file to any user.

Permissions changes

Change the access rights to "Linux" can only the owner or user who has administrator rights. To make changes to the terminal mode, use the chmod command.

It starts with parameters that allow you to change the rules using text (symbolic) or numeric notation. Consider how to set the permissions 777, which allow you to run, modify, and read the file to all users. In numeric mode, the command will look like this: chmod 777 filename , and in character: chmod a = rwx filename .

In practice, digital mode is often more convenient. After all, it's easier to write 755 than to set individual parameters for the owner, group and other users.

Recursive Change of Rights

The chmod command can be used in recursive mode, which allows you to replace the rights of all files in the directory and subfolders. To do this, use the -R switch.

An example of a command that shows how to set the permissions for 777 for all files in the current directory and its subdirectories:

Chmod -R 777 *.

Access rights and directories

In addition to files, you can set permissions on directories. For their designation the same parameters (flags) are used, but the behavior is somewhat different. The parameter that allows reading allows the user to view the list of contents of the folder, setting the record flag makes it possible to create new objects in the directory, and setting the execution right allows you to enter the directory.

Changing the permissions for directories is the same as for files with the chmod command.

Example:

Chmod 777 / home / test.

The above command shows how to set the permissions for 777 for the / home / test directory .

Security and access rights

It should be remembered that incorrect installation of access rights can disrupt the operation of the system or individual resources. In addition, it can lead to the creation of a major security problem. Therefore, it is necessary to make an analysis and get acquainted with the documentation. Particular attention should be paid to this before setting permissions 777, as they allow any user to create, modify and execute files in the directory.

Many criminals for hacking sites and other network resources use just the negligence of users who mistakenly left the right to download and execute any script or application on the server.

Extended Rights

There are situations when it is necessary to implement a complex scheme of access to information. In this case, the standard operating system rights "Linux" may not be enough. Then you have to resort to the use of access control lists (ACLs). Use this scheme only in very large networks with multi-level access schemes. In other cases, the standard functions of the operating system are bypassed .

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.atomiyme.com. Theme powered by WordPress.