

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 在 SMB 服务器上创建本地用户账户


您可以创建本地用户账户，用于授权通过 SMB 连接访问 SVM 中包含的数据。创建 SMB 会话时，也可使用本地用户账户进行身份验证。创建 SVM 时，默认启用本地用户功能。创建本地用户账户时，必须指定用户名，还必须指定要与该账户关联的 SVM。

**在 SMB 服务器上创建本地用户账户**

1. 使用 [https://docs.netapp.com/us-en/ontap-cli/vserver-cifs-users-and-groups-local-user-create.html](https://docs.netapp.com/us-en/ontap-cli/vserver-cifs-users-and-groups-local-user-create.html) ONTAP CLI 命令创建本地用户：

   ```
   vserver cifs users-and-groups local-user create -vserver svm_name -user-name user_name optional_parameters
   ```

   以下可选参数可能有所助益：
   + `-full-name`：用户的全名。
   + `-description`：对本地用户的描述。
   + `-is-account-disabled {true|false}`：指定启用还是禁用用户账户。如果未指定此参数，则默认启用用户账户。

   该命令提示输入本地用户的密码。

1. 输入本地用户的密码，然后确认该密码。

1. 验证用户是否已成功创建：

   ```
   vserver cifs users-and-groups local-user show -vserver svm_name
   ```

以下示例创建本地用户 `SMB_SERVER01\sue`，其全名为 `Sue Chang`，且与 SVM `svm1` 关联：

```
FSxIdabcde123456::> vserver cifs users-and-groups local-user create -vserver svm1 ‑user-name SMB_SERVER01\sue -full-name "Sue Chang"

Enter the password:
Confirm the password:
```

```
FSxIdabcde123456::> vserver cifs users-and-groups local-user show
Vserver  User Name                  Full Name  Description
-------- -------------------------- ---------- -------------
svm1     SMB_SERVER01\Administrator            Built-in administrator account
svm1     SMB_SERVER01\sue           Sue Chang
```