Linux permission management and Linux permission management

Source: Internet
Author: User

Linux permission management and Linux permission management
Linux Files have three identities and four permissions. The three identities are:
U: file owner
G: group to which the file belongs
O: other users
Each identity has four permissions:
R: read)
W: write Permission)
X: execute Permission)
S: special permissions
In the Linux File Permission explanation, we know that there are two methods in Linux to indicate the File Permission, which are numbers and symbols.
Chmod changes file permissions in numbers
Chmod 755 test. sh
Converts 755 to the character format rwxr-xr-x. That is to say, the owner, group, and other users of the file can read and run test. sh. sh


This file. (Of course, the root user does not have this restriction. It is also an experience that reflects the supreme power of the root account !)
It is easy to change the permissions of a file in the mathematical form. You only need to calculate the permissions that need to be granted to the file, and then call the chmod command. The call form is:
Chmod new permission file list
Chmod changes file permissions in character form
Chmod + x test. sh
The mathematical form can change the four permissions of all three identities of a file at a time, while the character form is more flexible and can be set separately for a permission of an identity, for example, the preceding command gives the execution permission to all three identities, and you can separate them separately.


Settings:
Chmod u + x test. sh only adds executable permissions to the owner
Chmod g + x test. sh only adds executable permissions to group identities
Chmod o + x test. sh only adds executable permissions to other identities
The preceding three commands are equivalent to the preceding command. They enable the executable permission function for all identities. You can also perform the following operations:
Chmod a + x test. sh
Here, a represents all three identities!
To remove a permission for an identity, you only need to change + to-. For example, you can remove the executable permissions for other identities:
Chmod o-x test. sh
For read and write permissions, follow these steps to perform more exercises. The following table lists the operations for chmod to change file permissions in character form:
Chmod u
G o
+ (Plus)-(minus) = (SET)
R w x
File or directory
Finally, let's look at a comprehensive example to illustrate similar problems in the future:
Chmod u = rwx, g + rx, o-x test. sh

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.