Updated on 2026-03-19 GMT+08:00

Unbinding a Key Pair

When you use a key pair to log in to an ECS, and you need to change the login mode to Password, unbind the key pair on the KPS management console. After the key pair is unbound, you can use the password to log in to the ECS.

Prerequisites

  • The ECS must be in the Running or Shut down state.
  • A key pair has been bound to an ECS.
  • The ECS whose key pair is to be unbound uses the public image provided by the cloud.
  • To unbind from a key pair, you can delete the public key of the user from the /root/.ssh/authorized_keys file on the server. Ensure that the file is not modified before unbinding from the key pair. Otherwise, the unbinding will fail.

Constraints

  • If you have not set a password for logging in to the ECS, or you have forgotten your password, reset the login password on the ECS management console. For details, see Elastic Cloud Server User Guide.
  • If you set login mode to Key Pair when you create the ECS, after the key pair is unbound, shut down the ECS first to bind a key pair again.
  • To log in to the ECS, after you unbind the key pair, reset the password in time on the ECS console. For details, see Elastic Cloud Server User Guide.
  • You can unbind an ECS on the KPS console for the following OSs: EulerOS, CentOS, RedHat, SUSE, Debian, OpenSUSE, Oracle Linux, Fedora, Ubuntu, AlmaLinux, Rocky Linux, CentOS Stream, and OpenEuler.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner of the management console and select a region or project.
  3. Click . Choose Security > Data Encryption Workshop.
  4. In the navigation pane on the left, click Key Pair Service.
  1. Click the ECS List tab, locate the target ECS in the list and click Unbind in the Operation column.

    • If the ECS is shut down, a dialog box will be displayed.
    • If the ECS is running, a dialog box will be displayed.

  2. If you unbind the key pair when the ECS is in the Running state, you need to upload the private key. Click Select file to upload the private key (in the .pem format) of the existing key pair or copy the private key to the text box. If the ECS is shut down, skip this step.

    • The private key to be uploaded or copied to the text box must be in the .pem format. If it is in the .ppk format, convert it by referring to "How Do I Convert the Format of a Private Key File?" in Data Encryption Workshop FAQs.

  3. The default port number is 22 and can be modified.

    Before using user-defined port, ensure that:

    • The key pair can be connected to the ECS using the port. For details about how to modify the security group configuration of an ECS, see "Configuring Security Group Rules".
    • Modify the default port of the ECS and ensure that the port is enabled. For details, see "How Can I Change a Remote Login Port?".
    • Modify the default port of the ECS and ensure that the port is enabled.

  4. Click OK. The key pair will be unbound from the ECS in about one minute.

    To log in to the ECS, after you unbind the key pair, reset the password in time on the ECS console. For details, see Elastic Cloud Server User Guide.