Linux basics: Linux expansion Permissions

Source: Internet
Author: User

Linux entry basics: Linux expansion permissions default permissions each terminal has an umask attribute to determine the default permissions for new files and folders umask are represented by digital permissions, for example, the default permission for the 022 directory is: the default permission for the 777-umask file is: 666-umask. For common users, the default umask is 002, and for root users, the default umask is 022, that is, for common users: the permission for creating a file is: 666-002 = 664 the permission for creating a directory is: 777-002 = 775 the command umask is used to view the set umask value $ umask to view the current umask value. (There are four bits, which will be discussed later) $ umask 022 adds the current umask value to the special permissions of 022, and uses the umask command to grant special permissions. Four bits are displayed, each digit occupies 3 bits, so the Linux permission binary has 12 bits, UGO occupies the last 9 bits, and the first three bits are special permissions. Effect of permissions on files on directories suid is executed as the directory to which the file belongs, the user of the non-execution file does not have the sgid to execute any new files created in the directory as the file owner group. The group to which the new files are created is the same as that of the directory. sticky does not have the write permission on the directory. users can only delete files they own, files Owned by other users cannot be deleted, for example, $ ls-l/usr/bin/passwd: -rwsr-xr-x 1 root 41284 Apr 9 2012/usr/bin/passwd U the x-bit permission is changed to s, indicating that this file is suid permission setting special permission setting suid: $ chmod u + s test set sgid: $ chmod g + s test Set sticky: $ chmod o + t test is the same as normal permission, special permissions can also be represented by numbers-SUID = 4-SGID = 2-Sticky = 1. Therefore, we can set the permission by using the following command: $ chmod 4755 test

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.