Introduction and calculation of Umask value in VSFTPD

Source: Internet
Author: User
Tags chmod file permissions

Add the Local_umask and Anon_umask values in the previous article. In a Linux system, when we create the default permissions for files. How do I change this default permission? There are local_umask items in the VSFTPD configuration: local_umask=022 First, we need to figure out what Umask is. When we create a file, we always have a default permission, so how does this permission come from? That's what Umask did. Umask set the user to create the default permissions of the file, it and chmod effect just the opposite, Umask set is the permission "complement", and chmod set is the file permission code. Umask values are generally set in/etc/profile, $ [Home]/.bash_profile, or $[home]/.profile. How to calculate the Umask value. The Umask command allows you to set the default mode at the time the file was created, and there is a number in the corresponding Umask value for each type of user (file owner, same group user, other user). For a file, the maximum value for this number is 6. The system does not allow you to give permission to execute a text file when it is created, and you must use the chmod command to add this permission after creation. The directory allows you to set execution permissions so that the number of umask can be up to 7 for the directory. The general form of the command is: Umask nnn where nnn is Umask 000–777. We just have to remember that Umask is "taking" the appropriate bits from the right. The table below is a comparison of the umask values and permissions: Umask file directory —————————— —— 0 6 7 1 6 6 2 4 5 3 4 4 4 2 3 5 2 2 6 0,------—————————— —— Linux file system: R:4 ( Read) W:2 (write) x:1 (execute) such as: Umask value is 022, the default directory permissions are 755, the default file permissions are 644. Multi-point Example: If the configured Umask value is 000, the default directory permissions are 777, and the default file permissions are 666 if the configured umask value is 047, the default directory permissions are 730, and the default file permissions are 620 is it very simple? This article in Sina Blog address is: http:/ /blog.sina.com.cn/s/blog_49fd52cf0100nekk.html

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.