Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use UMASK permissions in linux system

Shulou Source: shulou.com Published: 2022-06-01 22:13:09 09月30日 Update

This article will explain in detail how to use UMASK permissions in Linux systems, the quality of the article content is high, so Xiaobian shares it with you as a reference, I hope you have a certain understanding of related knowledge after reading this article.

A umask is usually used with the permissions you gave to a directory or file when you initially created it.

Here are two things to note:

1. For a directory, x permission means that you can enter the directory, so there is no problem with the initial assignment of this permission;

2. The permission for x of the file represents execution. This risk is too high, so the initial assignment of general permissions must remove x.

[root@www ~]# umask

0022

What do these four letters stand for?

First of all, the above four numbers represent the permissions assigned to initialize and discard. (For the corresponding file, x permission must be discarded by default even if it is not specified)

The first 0 represents the permission to discard suid;

The second 0 represents that the owner of this file/directory has not discarded any permissions (if it is a file, except x permission, why see the explanation above);

The third 2 represents that the user group of this file/directory has discarded the w permission (if it is a file, then its x permission is also discarded);

The third 2 indicates that the only permissions available to other users of this file/directory are r and x (except for files).

If you create a new file, its permissions are: -wr-w--w--that is: 644

If you create a new directory, its permissions are: dwrxw-xw-x, which is: 755

If you want to modify unask familiarity directly:

[root@www ~]# umask 002

About how to use UMASK permissions in linux system to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Tags: Permissions files representatives directories systems three content articles more users knowledge articles yes nothing only letters said owners numbers time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft macOS Docker Xiaomi Shulou Information