Usage of linux UMASK

Source: Internet
Author: User

In linux, UMASK is generally used to grant permissions to a directory or file when you create a directory or file. Here we need to explain two points: 1. For the directory, the x permission indicates that the directory can be accessed, so there is no problem with the initial assignment of this permission; 2. the permissions on file x represent execution, which is too risky. Therefore, the initial permission assignment must be removed from the permissions on file x. www.2cto.com [root @ www ~] # What are the four letters of umask0022? First of all, the above four numbers indicate the permissions to be assigned for initialization and discard. (For the corresponding file, the x permission must be discarded by default even if it is not described as discarding.) The first 0 represents the suid permission to discard; the second 0 indicates that the owner of the current file/directory has not discarded any permissions (except for file x permissions ); the third 2 indicates that the user group of the current file/directory has discarded w permissions (if it is a file, its x permissions are also discarded ); the third 2 represents that other users in this file/directory can only use r and x (except for files ). According to www.2cto.com, If you create a new file, the permission is-wr-w -- that is: 644. If you create a new directory, the permission is: dwrxw-xw-x is: 755 if you want to modify the unask familiarity, go directly to [root @ www ~]. # Umask 002 understand it!

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.