Help Center/ Cloud Bastion Host/ User Guide/ Policy/ Command Rules/ Creating and Managing Command Sets
Updated on 2026-07-30 GMT+08:00

Creating and Managing Command Sets

Scenarios

To simplify the process of repeatedly adding a large number of commands, you can add multiple commands to a command set and associate the command set with a rule to enable centralized authorization.

Notes and Constraints

When you create a command set, it automatically belongs to your department by default. The department cannot be changed.

Prerequisites

Your role has the management permission for the Cmd Rules module. For details about the permissions of each role, see Role.

Creating a Single Command Set

You can create one command set by following the way below. You need to add commands to the command set based on your needs.

  1. Log in to your bastion host system.
  2. In the navigation pane on the left, choose Policy > Cmd Rules > CmdSet to go to the command set list page.
  3. On the displayed page, click New in the upper right corner of the page.
  4. Configure the command set name.

    • The command set name must be unique in a bastion host.
    • Naming rules: The name can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed.

  5. Click OK.

    You can return to the command set list page and view the new command set. You also need to add commands to the command set. For details, see Adding Commands to a Command Set.

Adding Commands to a Command Set

  1. Log in to your bastion host system.
  2. In the navigation pane on the left, choose Policy > Cmd Rules > CmdSet to go to the command set list page.
  3. In the Operation column of the target command set, click Command.
  4. Enter commands in the text box.

    • A maximum of 2,000 commands are allowed. Enter one command in each line.
    • Each command can contain 1 to 100 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

  5. Click OK.

Batch Importing Command Sets

You can prepare command sets online and import them all at once into the system.

  1. Log in to your bastion host system.
  2. In the navigation pane on the left, choose Policy > Cmd Rules > CmdSet to go to the command set list page.
  3. Click in the upper right corner.
  4. In the displayed dialog box, click Download template and download the import template.
  5. Prepare command sets according to the template.
  6. In the displayed dialog box, click Upload and upload the completed command set form.

    • Only .xls, .xlsx, and .csv files can be uploaded.
    • To overwrite an existing command set, select Override existing command set.

  7. Click OK to complete the upload.

    On the command set list page, you can view imported command sets.

Viewing and Editing a Command Set

  1. Log in to your bastion host system.
  2. In the navigation pane on the left, choose Policy > Cmd Rules > CmdSet to go to the command set list page.
  3. Locate the row that contains the target command set, and click the command set name or Manage in the Operation column to go to the details page.
  4. View and modify the basic information about the command set.

    • In the Basic Info area, view the department and name of the command set.
    • In the Basic Info area, click Edit on the right. In the displayed dialog box, change the command set name.
      • The command set name must be unique in a bastion host.
      • Naming rules: The name can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed.

  5. View and modify commands in the command set.

    • In the list in the Command area, view the commands in the command set.
    • In the Command area, click Add on the right to add commands to the current command set.
      • A maximum of 2,000 commands are allowed. Enter one command in each line.
      • Each command can contain 1 to 100 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.
    • Locate the row that contains the target command and click Remove to delete the command from the current command set.

Deleting a Command Set

  1. Log in to your bastion host system.
  2. In the navigation pane on the left, choose Policy > Cmd Rules > CmdSet to go to the command set list page.
  3. Delete a command set.

    • Deleting a single command set
      1. In the row containing the target command set, click Delete in the Operation column.
      2. In the displayed dialog box, click OK.
    • Batch deleting command sets
      1. On the command set list page, select all the target command sets.
      2. Click Delete in the lower left corner.
      3. In the displayed dialog box, click OK.