Облачная платформаAdvanced

Managing Host and Database Resources with a Bastion Host

Эта статья полезна?
Язык статьи: Английский
Перевести

A bastion host can manage hosts through a wide range of protocols, such as SSH, RDP, VNC, Telnet, FTP, SFTP, DB2, MySQL, SQL Server, Oracle, SCP, Redis, and Rlogin. You can use a bastion host to manage Windows servers, Linux servers, and databases.

This topic describes how to use a bastion host to centrally manage your host resources. We will introduce how to add a host resource, automatically discover host resources, and clone host resources.

Notes and Constraints

  • The total number of host and application resources to be added cannot exceed the number of assets.
  • The combination of Protocol, Host Address, and Port must be unique in a bastion host system. This means the host resources to be managed must be unique. Otherwise, when you create a host resource with the same configuration, an error message will be displayed, indicating that the host resource already exists.
  • To set Department to a superior department for a host resource, you must have management permissions for the Department module. For details about how to modify the management permissions for a user role, see Viewing or Modifying the Basic Information and Permissions of a Role.

Prerequisites

  • You have the operation permissions for the Host module.
  • To manage a Linux server using VNC, run a local connectivity test first and ensure that the VNC is properly connected to the Linux server.

    CBH does not ensure the compatibility of third-party VNC software.

Adding a Host or Database Resource

  1. Log in to your bastion host system.
  2. Choose Resource > Host in the navigation pane on the left.
  3. Click New in the upper right corner of the page.

    Enter the required network information and basic information of the host resource you want to add.

    Table 1 Parameters for adding a resource

    Parameter

    Description

    Host Name

    Custom name of the host resource. A host name must be unique in a bastion host.

    Protocol

    Type of the protocol configured for the host.

    • In the professional edition, you can configure SSH, RDP, VNC, Telnet, FTP, SFTP, DB2, MySQL, SQL Server, Oracle, SCP, Rlogin, Redis, and DM.
    • In standard editions, you can configure SSH, RDP, VNC, Telnet, FTP, SFTP, SCP, and Rlogin for a host.

    Connection Type

    This parameter is available when Protocol is set to SSH or RDP.

    Select a connection type. The options are Direct and Proxy. If you select Proxy, you need to select a proxy server. For details about how to add a proxy server, see Managing Proxy Servers.

    Host Address

    Host IP address that can be used to establish a connection with your bastion host.

    • Select the EIP or private IP address of the host. Private IP addresses are recommended.
      NOTE:

      A private IP address on the same VPC network is recommended. The network stability and proximity will affect the O&M activities through a bastion host. The external access port of the private IP address is not restricted by the network security (security group and ACL) policies. While the port for external access over an EIP is restricted by network security policies. So a managed host resource may become inaccessible over an EIP through the bastion host.

      It is recommended that you set the Host Address to a private IP address on the same VPC network.

    • By default, the IPv4 address of the host is used. After an IPv6 address is enabled for a host, select either the IPv4 address or IPv6 address.

    Port

    Port number of the host.

    OS Type

    (Optional) Type of the host OS or device OS.

    • The default value is empty. You need to select an OS type based on the type of the added resources.
    • Multiple default OS types are provided. The system administrator admin can customize OS types. For details, see OS Types.

    Terminal Speed

    If you select Rlogin for Protocol, you can select different terminal speeds.

    Encode

    If you select SSH or TELNET for Protocol, you can use Chinese operation page.

    The options are UTF-8, Big5, and GB18030.

    Terminal Type

    If you select SSH or TELNET for Protocol, you can specify the operation terminal you want.

    You can select Linux, Xterm-256color (default), or Xterm.

    Options

    (Optional) Select File Manage, X11 forward, Uplink Clipboard, Keyboard Audit, and/or Downlink Clipboard.

    • File Manage: This option is supported only by SSH, RDP, and VNC hosts.
    • Clipboard: This option is supported only by SSH, RDP, and Telnet hosts.
    • X11 forward: This option is supported only by SSH hosts.
    • Keyboard Audit: Only RDP, VNC, and protocol hosts can be configured.

    Department Name

    Department to which the host resource belongs.

    Label

    (Optional) You can customize a label or select an existing one.

    Remarks

    (Optional) A description of the host resource.

  4. Click Next to add a resource account for the host or database.

    Note

    If no accounts are configured for the managed hosts, account [Empty] is generated by default. When you log in to the managed host through a bastion host for operations, select [Empty] and enter the username and password of an account of the host.

    Table 2 Parameters of managed host accounts

    Parameter

    Description

    Add Account

    When to add the account. The options are Rightnow and Afterward.

    • If you select Rightnow, continue the configuration on the page to add the account immediately.
    • If you select Afterward, no further configuration is required on the page. You can add the account information later in the resource list or on the resource details page.

    Login Type

    Select a login type.

    • If you select Auto Login, Account and Password are mandatory.

      If you select the automatic login mode, select Allow to change the SSH Key when creating a password rule, or manual password change may fail.

    • If you select Manual Login, Account and Password are optional.
    • If you select CSMS Credentials Login, make sure you have available credentials.

    Account

    Account name of the host. The value of Account must be unique in a bastion host and cannot be changed after it is created.

    If you select It's a sudo account, the account is identified as a sudo account for managing resources and has the password change permission.

    If the AD domain service is installed on the host, the added account is DomainName\HostAccountName, for example, ad\administrator.

    Password

    Password of the account being added.

    By default, Verify is selected. After the account is added, the system automatically verifies the status of the account.

    • After the account is verified, the resource information is saved.
    • If the verification fails, modify the configuration as prompted.
      • If the system prompts that the account verification times out, return to the configuration window and modify the resource information. If the root account is used, ensure that the root login permission has been enabled on the host.
      • If the system prompts that the account password is incorrect, return to the configuration window and change the account password.

    Postgresql/Gaussdb/DB2/Oracle Param

    This parameter is available when you create a PostgreSQL, GaussDB, DB2, or Oracle resource.

    Enter database names to specify the databases that the current resource account can access. You can specify up to 20 databases.

    SSH Key

    This parameter is available when you create an SSH resource.

    Configure SSH key authentication. After the configuration is complete, the SSH key is preferentially used to log in to the SSH host resource. An RSA private key in PEM or RFC4716 format is supported.

    Passphrase

    This parameter is available when you create an SSH resource.

    Private key sequence corresponding to the SSH key. This parameter is optional.

    • You do not need to enter the password for logging in to the host when no private key password is generated.
    • You need to enter the private key password each time you log in to the host when the private key password is generated.

    Login Role

    This parameter is available when you create an Oracle resource.

    Select a role for logging in to the host resource.

    Description

    Brief description of the account.

  5. Click OK. After the account is verified, you can then view the new host resource under the Host tab.

Automatically Discovering Host or Database Resources

With the Auto Discover function, you can use Nmap to scan for hosts in a specific IP address or IP address range.

Note

Host resources can be automatically discovered only when the hosts and your bastion host are in the same VPC and the network connection is normal.

  1. Log in to your bastion host system.
  2. Choose Resource > Host in the navigation pane on the left.
  3. Click Auto Discover in the upper right corner of the page.
  4. Enter the IP address and port number of host resources to be imported.

    The default ports are 21, 22, 23, 3389, and 5901. You can also add other ports or port ranges.

  5. Click OK to start the auto discovery.
  6. Select the host resources to be imported.

    • Enter a host name. If you do not enter the host name, the default host name is the IP address of the host.
    • A protocol type is set automatically for the host based on default port. If the host does not match the default port, manually select a protocol type.

  7. Select the discovered hosts and click Add.

    Click Return or Close to return to the host resource list page and view the newly added host resources.

Cloning Host or Database Resources

If you want to add a host as many types of resources to your bastion host, you can copy the one you have added and change its configurations to add the modified one as another host resource.

  1. Log in to your bastion host system.
  2. Choose Resource > Host in the navigation pane on the left.
  3. In the Operation column of an added host resource, choose More > Clone.
  4. Modify information of the host resource and add accounts for the new host resource.

    To complete the host clone, modify at least one of the following parameters of the host resource you select: Protocol, Host Address, and Port.

  5. Click OK. The host list page is displayed. You can check the new host resource on the displayed page.