Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Command modes in CloudHSM CLI

Focus mode
Command modes in CloudHSM CLI - AWS CloudHSM

In CloudHSM CLI, you can run commands two different ways: in single command mode and interactive mode. Interactive mode is designed for users, and single command mode is designed for scripts.

Note

All commands work in interactive mode and single command mode.

Interactive mode

Use the following commands to start CloudHSM CLI interactive mode

Linux
$ /opt/cloudhsm/bin/cloudhsm-cli interactive
Windows
C:\Program Files\Amazon\CloudHSM\bin\> .\cloudhsm-cli.exe interactive
$ /opt/cloudhsm/bin/cloudhsm-cli interactive

When using the CLI in Interactive Mode, you can log in to a user account using the login command.

To list all CloudHSM CLI commands, run the following command:

aws-cloudhsm > help

To get the syntax for a CloudHSM CLI command, run the following command:

aws-cloudhsm > help <command-name>

To get a list of users on the HSMs, enter user list.

aws-cloudhsm > user list

To end your CloudHSM CLI session, run the following command:

aws-cloudhsm > quit

Single Command mode

If you run CloudHSM CLI using Single Command Mode, you need to set two environment variables to provide credentials: CLOUDHSM_PIN and CLOUDHSM_ROLE:

$ export CLOUDHSM_ROLE=admin
$ export CLOUDHSM_PIN=admin_username:admin_password

After doing this, you can execute commands using the credentials stored in your environment.

$ cloudhsm-cli user change-password --username alice --role crypto-user Enter password: Confirm password: { "error_code": 0, "data": { "username": "alice", "role": "crypto-user" } }

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.