Read and write executable permission issues for folders and files under Linux system

Source: Internet
Author: User
Tags readable

Linux is a multi-user operating system, Linux for all files within the file system, the implementation of strict permissions division management. Prevents users who do not have permissions from accessing a file.
The permissions of a Linux file or directory are divided into three permissions: Read, write, and execute.
The user category for file access is divided into the file creator, the same group as the creator of the file, and the other user class three.
Explanatory notes:
Drwxr-xr-x
One:
DRWXR permissions created by the creator
R-x permissions for users with the same group as the owner
R-x permissions owned by other users
Linux uses their combination to represent the permissions of a document or directory!
D rwx R-x R-x
Directory belongs to the Master permission group permissions other permissions
For owners of this directory, read, write, execute permissions
For the genus of this directory, there is a read, execute, no write right (no permission with "-" to represent)
Other people have the same permissions as group permissions.
Two:
The first bit represents the file type. D is the directory file, L is the link file,-is the normal file, p is the pipeline
第2-4位 represents the owner-owned permission of this file, R is read, W is write, X is execute.
第5-7位 represents the permissions of the user who is the owner of the same group as the file.
第8-10位 represents the permissions that other users have.

Ways to view folder or file permissions:
Method One: Ls-l (this parameter is the lowercase letter L, not the number 1)
Method Two: LL

File attributes for Linux:
The abbreviation for directory D, directory.
The abbreviation for read, R.
The abbreviation for write, W.
Readable (R), writable (W), executable (x)
-delete permission is represented by the number 0
s special permissions
R=4,w=2,x=1
To rwx the attribute then 4+2+1=7;
To rw-the attribute then 4+2=6;
To r-x the property, 4+1=5.

The chmod command is used to change access rights for Linux system files or directories. Use it to control the access rights of a file or directory
Access to a file or directory is divided into read-only, write-only, and executable three types.
There are three different types of users who can access files or directories: The file owner, the same group of users, and other users.
Each file or directory has three groups of access rights, each group is represented by three bits, respectively, the read, write, and execute permissions of the file owner, the read, write, and execute permissions of the user belonging to the primary group, and the read, write, and execute permissions of other users in the system.
When you use the LS-L command to display the details of a file or directory, the leftmost column is the file's access rights.

Example:
1. The command to modify the file's permissions or directory is "chmod 755 test.sh".
755 means "The creator has read and write executable permissions, the same group of users, and other users have access to reading and execution."
How "755" is made up of: "0" means no permissions, "1" For executable permissions, "2" for writable permissions, and "4" for readable permissions. "7=1+2+4,5=1+4".
2.chmod-r 777 Folder
777 means open All permissions
To consider the setting of security general permissions, we recommend that directory permissions 755 file Permissions 644

Note: The essay content is from the online data collation, for reference only.

Read and write executable permission issues for folders and files under Linux system

Related Article

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.