---
title: 设置umask
description: "建议用户将主机（包括宿主机）和容器中的umask设置为027及以上，提高安全性。"
url: https://www.hiascend.com/document/detail/zh/mindcluster/latest/toolbox/toolboxug/toolboxug_0119.html
sourcePath: /source/zh/mindcluster/2610/toolbox/toolboxug/toolboxug_0119.html
indexId: 9158f8058879ef7c8e1ff1596127aeab634dbe6a03e69d71aac7982b01a7424c65
---
# 设置umask

建议用户将主机（包括宿主机）和容器中的umask设置为027及以上，提高安全性。

以设置umask为077为例，具体操作如下所示。

1. 以root用户登录服务器，编辑“/etc/profile”文件。

```
vim /etc/profile
```


2. 在“/etc/profile”文件末尾加上umask 077，保存并退出。
3. 执行如下命令使配置生效。

```
source /etc/profile
```
