---
title: 设置umask
description: "建议用户将主机（包括宿主机）和容器中的umask设置为0027及以上，提高安全性。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/softwareinst/instg/instg_0041.html
sourcePath: /source/zh/canncommercial/900/softwareinst/instg/instg_0041.html
indexId: b27f5ff70dcb9f7a5dd7aed4aee8765bdcd826d3eb653e4b577c95ee030eee8b64
---
# 设置umask

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

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

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

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