Get the App
SLTechnology News&Howtos  ›  Servers  › 

Review the relevant knowledge of directory permissions in UNIX/linux file system

Shulou Source: shulou.com Published: 2022-06-02 07:06:08 10月03日 Update

The file system rights management of the UNIX/linux system is a little vague, so let's review:

File system directory permissions:

Second, the user's understanding of UMASK:

When you first log in to the system, the u m a s k command determines the default mode in which you create files. This command is actually the opposite of the c h m o d command. Your system administrator must set a reasonable u m a s k value for you to ensure that the files you create have the default permissions you want and prevent other different groups of users from having write access to your files. After you have logged in, you can use the u m a s k command to change the default permissions for file creation according to your personal preference. The corresponding changes are in effect until you exit the s h e l l or use another u m a s k command. Generally speaking, the u m a s k command is set in the / e t c / p r o f i l e file, which is referenced by each user when logging in, so if you want to change the u m a s k of all users, you can add the appropriate entry to this file. If you want to set your u m a s k value permanently, put it in your $H O M E directory. P r o f i l e or. In b a s h p r o f i l e file.

The default permissions for file and directory creation corresponding to the u m a s k value 002 are 6 6 4 and 7 7 5, respectively. There is another way to calculate the u m a s k value. We just have to remember that u m a s k "takes" the corresponding bits from the permissions.

Tags: File permission system command user directory login management review valid generally speaking personal preference actual actually method is in entry mode permanent Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Xiaomi OPPO Reno Shulou Technology MySQL