Linux permission setting command

Source: Internet
Author: User

The format obtained by using the ls command for linux permission setting is similar to-rwxr-xr-x. The meaning of the format is parsed below. This representation has a total of ten digits: 9 8 7 6 5 4 3 2 1 0-r w x r-x 9th bits to indicate the file type, it can be p, d, l, s, c, B, and -: p indicates the named pipeline file d indicates the directory file l indicates the symbolic connection file-indicates the common file s indicates the socket file c indicates the character device file B indicates the 8-6 bits, 5-3 bits, and 2-0 bits of the block Device File bits indicate the permissions of the file owner, permissions of users in the same group. permissions of other users are in the form of rwx. In linux, using chmod (change file modebit) to change the permissions of a file can be either of the following methods: 1. the chmod [ugoa] [+-=] [rwx] filename method is intuitive, u represents the owner (user), g Represents the group, o Represents other users (other), and a represents all users (all ). +-= Indicates adding, removing, and setting the corresponding permissions. Rwx represents read, write, and exe respectively ). For example, chmod a + x filname indicates that the execution permission on filename is added to all users. 2. setUid and setGid if SUID is set for a command, the user who executes the command has the permission of the owner of the command during execution; if an SGID is set for a command, the user who executes the command has the Group permission for the command during execution. set SetUid permission: chmod 4xxx filename cancel SetUid permission: chmod xxx filename set SetGid permission: chmod 2xxx filename cancel SetGid permission: if you run the "chmod 6xxx filename" command, you can set SetUid and SetGid for the specified file and run the command "chmod 0xxx filename" to cancel the SetUid and SetGid permissions for the specified file.

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.