11. Self-Learning Linux path: User and Rights Management

Source: Internet
Author: User
Tags create directory

Permissions:

For files:

READ: Read (R)

R: Available cat,more,less to view, you can use the Content view Class command to display related content.

Write: Write (W)

W: You can use the Content editor to modify its contents.

Executable: Execute (x)

X: It can be initiated as a process, which we hand over to the kernel, which is started by the kernel as a process.

For catalogs:

R: You can use the LS command to view file information for directory contents.

W: can create, delete files.

X: You can use the Ls-l command to view file information for directory content, and you can use the CD command to switch the directory to the working directory.

   #ls-L:

You can view a 10-bit symbol bit composed of rwx.

The first bit is the file type, and the second nine bits each three bits represent the owner, the group, and the other user's permissions.

The Permissions property of the file, and the metadata is stored in the inode file.

The owner of the modified file belongs to a group : Only administrators have permission to perform such operations.

 chown: Change owner

 chgrp: Change Group

Modify file Permissions : chmod, change person r,w,x

Mode one: Operate the permissions of the three categories of users: using the 3-bit 8 binary number form.

Mode two: Manipulate the permissions of the user of the specified category: Use U,g,o,a to assign a value, based on = or +/-.

Method Three: The right to refer to other files is currently assigned.

Way One:

        rw-r--r-- -    rwxr-xr-- 644->754

        #chmod octal_mode FileName ....

Example:#chmod 754 ruinian.c

-R: Modify both the directory permissions and the internal file permissions, recursively change. However, this action is not valid for linked files.

Way two:

        chmod

-U: Owner

-G: Genus Group

-O: Other users

-A: Used

        =: Operation permissions for the specified type of user

        +/-: operation of individual permissions for users of the specified category

Example: #chmod 750/file_name

#chmod u=rwx U=rx o=/file_name

    

Way three:

        #chmod--reference= file to be modified for reference

Example:#chmod--reference=.bash_logout. Bash_profile

    

Umask

Create file: 666 minus the umask value is the right to create the file: The file default does not allow Execute permissions.

Create directory: 777 minus the umask value for the created file permissions

      #umask: View the value of Umask

      #umaskNumber: Change the value of Umask

Exit the current user, then login, the value of Umask will be updated to the original value, if you want to permanently exist, change the configuration file

If the user name is the same as the basic group name:umask = 002

If the user name is not the same as the base group name:umask = 022

Administrator:umask = 022

      

      

                  

  

11. Self-Learning Linux path: User and Rights Management

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.