Linux Permissions in detail, multi-user groups of various permissions configuration principle

Source: Internet
Author: User

There are too many details about Linux permissions on the Web, not to be verbose here. The main explanation is that these permissions are miscellaneous, otherwise know what users, groups and other permissions are not good enough.

I. Classification of rights

R: Read permission, the number code is "4".
W: Write permission, the number code is "2".
X: Execute or toggle permissions, the number code is "1".
-: No permission, number code is "0".

Each segment in Linux is a value of r+w+x, Max 777, see


Ii. when the permission is used

Directory Write permission: You can delete all contents in the directory, change the file and directory name.

Directory Read permission: Can ls this directory.

Directory execution: You can enter subdirectories of the directory.


File Write permission: Can change the contents of the file

File Read permission: Can check file

File execution rights: can execute File command


Third, user group permissions to use

The basic knowledge is not much said, self-check, only the specific effect.

Suppose Gruop is as follows:

getso:x:502:jerry,laohujerry:x:506:

Jerry was the owner of the Jerry Group and belonged to the Getso group. Laohu is not the master, only belongs to the Getso group.

Effect:

Jerry and Laohu access to Getso files with group permissions

Getso access to Jerry and Laohu files with public permissions

Laohu access to Jerry with public permissions, access to Getso with group permissions

Laohu created file belongs to Getso Group

The files created by Jerry and Getso belong to their own group.


Such a variety of places do not have access to the control of this to solve the better.


Iv. User Group changes

Usermod-g Getso Jerry makes Jerry a member of Getso.

Usermod-g Getso Jerry made Jerry a member of Getso, and Jerry was not the leader.

Gpasswd-m Jerry Getso made Jerry a member of Getso.

gpasswd-d Jerry Getso makes Jerry no longer a member of Getso.




Linux Permissions in detail, multi-user groups of various permissions configuration principle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.