Updated on 2024-09-24 GMT+08:00

Managing Command Sets

To relieve you from complicated and repetitive workloads on adding a large number of commands to command rules, a bastion host provides command sets, which include common commands and parameters used for Linux hosts and network devices.

This topic walks you through how to create, view, modify, delete, and batch import command sets.

Prerequisites

You have obtained the permissions to manage the Cmd Rules module.

Creating a Command Set

  1. Log in to your bastion host.
  2. Choose Policy > Cmd Rules > CmdSet to go to the command set list page.
  3. Create a command set.

    1. Click New in the upper right corner of the page to switch to the New Command Set dialog box.
    2. Configure the command set name.

      The command set name must be unique in a bastion host.

    3. Click OK. You can then view the new command set on the CmdSet tab.

  4. Add commands to the command set.

    1. In the row of the command set you want to add commands, click Command in the Operation column. The Command dialog box is displayed.
    2. Select command sets or a single command.

      Currently, common commands for Linux and Network devices are preset in a bastion host.

    3. Click OK.

Querying and Editing a Command Set

  1. Log in to your bastion host.
  2. Choose Policy > Cmd Rules > CmdSet to go to the command set list page.
  3. Query a command set.

    Quick search: Enter a keyword in the search box to quickly query command sets by command set name, command, and/or parameter.

  4. Click the command set name or click Manage in the row of the command set in the Operation column.
  5. View and edit basic information.

    In the Basic Info area, click Edit. In the displayed dialog box, edit the basic information.

    You can edit CommandSet Name. The Department cannot be changed.

  6. View and edit commands and parameters in the Command area.

    • To add preset commands or parameters, click Add in the Command area and select preset commands in the displayed dialog box.
    • To delete a command or parameter, locate the row containing the command or parameter you want to delete and click Remove.

Deleting a Command Set

  1. Log in to your bastion host.
  2. Choose Policy > Cmd Rules > CmdSet to go to the command set list page.
  3. To delete one command set, click Delete in the Operation column of the row where the command set locates.
  4. To delete multiple command sets at a time, select the ones you want to delete and click Delete at the bottom of the list to delete all selected command sets together.

Batch Importing Command Sets

  1. Log in to your bastion host.
  2. Choose Policy > Cmd Rules > CmdSet to go to the command set list page.
  3. Click in the upper right corner. In the displayed dialog box, download the template.
  4. Complete the template. Click Upload to import.

    You can choose to overwrite existing command sets.

    Only XLS, XLSX, and CSV files can be uploaded.

  5. Confirm the information and click OK.