User Permissions in Linux

Source: Internet
Author: User
Article Title: about user permissions in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Overview

Objects for LINUX File permissions are divided into three types (Mutual Exclusion ):

1. user (file owner)

2. group (the group of the file owner, but not the user)

3. other (other users, other than user and group)

In LINUX, a three-digit binary number corresponds to the three permissions of the file (1 indicates that the permission is available, and 0 indicates that the permission is unavailable ):

1st-bit read r 100 4

2nd-bit write w 010 2

3rd-bit execution x 001 1

View Permissions

# Ls-l

In the first column, a total of 10 bits (drwxrwxrwx) represent the permissions of the file:

1) The first d indicates a directory. If "-" is displayed, it indicates that it is not a directory.

2) 2-4 represents the user's Permissions

3) 5-7 represents the group permission

4) 8-10 indicates the permission of other.

For the last 9 digits:

R indicates read. Its value is 4.

W represents writeable (write), and its value is 2

X indicates executable, and its value is 1.

-Indicates that you do not have the required permissions. The value is 0.

Modify file permissions

# Chmod [ugoa] [+-=] [rwx] File Name

1) User

U stands for user

G stands for group

O Represents other

A Represents all people, including u, g, and o

2) Action

+ Indicates adding permissions.

-Indicates the permission to be deleted.

= Indicates that it is the only permission

3) Permission

Rwx can also be expressed in numbers, but it is difficult to calculate it by yourself, such as rw = 6

Common Permissions

-Rw -- (600) only the owner has the read and write permissions.

-Rw-r -- (644) only the owner has the read and write permissions. The Group and others have only the read permissions.

-Rwx -- (700) only the owner has the read, write, and execute permissions.

-Rwxr-xr-x (755) only the owner has the read, write, and execute permissions. The Group and others have only the read and execute permissions.

-Rwx -- x (711) only the owner has the read, write, and execute permissions. The Group and others have only the execution permissions.

-Rw-(666) everyone has the read and write permissions.

-Rwxrwxrwx (777) everyone has the read and write permissions and the maximum permission.

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.