Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the UMASK permission in linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what the UMASK permission in linux is, and the editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

We all know that after creating a file or directory under linux, you can set permissions through commands such as chmod to assign different access rights to current users, user group users, and other users. So, our newly created directory and file itself has its default permissions, which are determined by the permission mask umask.

Here are two points:

1. As far as the directory is concerned, the x permission represents access to the directory, so there is no problem with the initial assignment of this permission

2. the permission for x of the file represents execution, which is too risky, so the initial assignment of general permissions must remove the value of x

[root@www ~] # umask0022

What do these four letters stand for?

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

The first 0 represents the permissions discarded by suid

The second 0 means that the owner of this file / directory has not discarded any permissions (if it is a file, except for the x permission, why take a look at the explanation above)

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

The third 2 represents that other users of this file / directory can only use r and x (except files).

To sum up, if you create a new file, its permissions are:-wr-w-w-: 644

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

If you want to modify unask familiar with directly:

[root@www] # umask 002The article on "what is UMASK permission in linux" ends here. I hope the above content can be helpful to you so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report