Help Center/ Auto Scaling/ FAQs/ Others/ Why Can't I Use a Key File to Log In to an ECS?
Updated on 2025-08-25 GMT+08:00

Why Can't I Use a Key File to Log In to an ECS?

Issue Description

When you used a key file to attempt to log in to an instance in an AS group, the login failed.

Possible Causes

The image specified in the AS configuration of the AS group is a private image, on which Cloud-Init has not been installed.

In this case, user data cannot be injected into the ECS. You can only log in to the ECS using the password or key pair specified in the image.

Handling Method

  1. Check whether the ECS needs to be logged in to.
    • If yes, use the image password or key pair to log in to this ECS.

      The original image password or key pair is the OS password or key pair configured when the private image was created.

    • If no, go to step 2.
  2. Change the AS configuration for the AS group. For details, see Changing the AS Configuration for an AS Group.

Make sure that Cloud-Init or Cloudbase-Init has been installed on the image specified in the new AS configuration. For how to install Cloud-Init or Cloudbase-Init, see Image Management Service User Guide.

After the AS configuration is changed, you can use the key file to log in to the new ECSs that are added to the AS group during scaling actions. You do not need to use the image password or key pair to log in to these new ECSs anymore.