

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

# 使用 AWS CloudHSM 管理实用程序创建 HSM 用户
<a name="create-users-cmu"></a>

**createUser**在 AWS CloudHSM 管理实用程序 (CMU) 中使用，在硬件安全模块 (HSM) 上创建新用户。必须以 CO 身份登录才能创建用户。

**创建一个新的 CO 用户**

1. 使用配置工具更新 CMU 配置。

------
#### [ Linux ]

   ```
   $ sudo /opt/cloudhsm/bin/configure --cmu <IP address>
   ```

------
#### [ Windows ]

   ```
   PS C:\> & "C:\Program Files\Amazon\CloudHSM\configure.exe" --cmu <IP address>
   ```

------

1. 启动 CMU。

------
#### [ Linux ]

   ```
   $ /opt/cloudhsm/bin/cloudhsm_mgmt_util /opt/cloudhsm/etc/cloudhsm_mgmt_util.cfg
   ```

------
#### [ Windows ]

   ```
   PS C:\> & "C:\Program Files\Amazon\CloudHSM\cloudhsm_mgmt_util.exe" C:\ProgramData\Amazon\CloudHSM\data\cloudhsm_mgmt_util.cfg
   ```

------

1. 以 CO 用户身份登录 HSM。

   ```
   aws-cloudhsm > loginHSM CO admin co12345
   ```

   确保 CMU 列表的连接数与集群 HSMs 中的连接数相匹配。如果没有，请注销并重新开始。

1. 使用 **createUser** 创建名为 **example\$1officer** 的 CO 用户，密码为 **password1**。

   ```
   aws-cloudhsm > createUser CO example_officer password1
   ```

   CMU 会提示您关于创建用户操作的信息。

   ```
   *************************CAUTION********************************
   This is a CRITICAL operation, should be done on all nodes in the
   cluster. AWS does NOT synchronize these changes automatically with the
   nodes on which this operation is not executed or failed, please
   ensure this operation is executed on all nodes in the cluster.
   ****************************************************************
   
   Do you want to continue(y/n)?
   ```

1. 键入。**y**

**创建一个新的 CU 用户**

1. 使用配置工具更新 CMU 配置。

------
#### [ Linux ]

   ```
   $ sudo /opt/cloudhsm/bin/configure --cmu <IP address>
   ```

------
#### [ Windows ]

   ```
   PS C:\> & "C:\Program Files\Amazon\CloudHSM\configure.exe" --cmu <IP address>
   ```

------

1. 启动 CMU。

------
#### [ Linux ]

   ```
   $ /opt/cloudhsm/bin/cloudhsm_mgmt_util /opt/cloudhsm/etc/cloudhsm_mgmt_util.cfg
   ```

------
#### [ Windows ]

   ```
   PS C:\> & "C:\Program Files\Amazon\CloudHSM\cloudhsm_mgmt_util.exe" C:\ProgramData\Amazon\CloudHSM\data\cloudhsm_mgmt_util.cfg
   ```

------

1. 以 CO 用户身份登录 HSM。

   ```
   aws-cloudhsm > loginHSM CO admin co12345
   ```

   确保 CMU 列表的连接数与集群 HSMs 中的连接数相匹配。如果没有，请注销并重新开始。

1. 使用 **createUser** 创建名为 **example\$1user** 的 CU 用户，密码为 **password1**。

   ```
   aws-cloudhsm > createUser CU example_user password1
   ```

   CMU 会提示您关于创建用户操作的信息。

   ```
   *************************CAUTION********************************
   This is a CRITICAL operation, should be done on all nodes in the
   cluster. AWS does NOT synchronize these changes automatically with the
   nodes on which this operation is not executed or failed, please
   ensure this operation is executed on all nodes in the cluster.
   ****************************************************************
   
   Do you want to continue(y/n)?
   ```

1. 键入。**y**

有关 **createUser** 的更多信息，请参阅 [createUser](cloudhsm_mgmt_util-createUser.md)。