Help Center/ Elastic Cloud Server/ API Reference/ Out-of-Date APIs/ Password Management/ Resetting the Password for Logging In to an ECS with a Few Clicks (Discarded)
Updated on 2024-07-16 GMT+08:00

Resetting the Password for Logging In to an ECS with a Few Clicks (Discarded)

Function

This API is used to reset the password of the ECS management account, root or Administrator.

This API has been discarded. Use the API described in Resetting the Password for Logging In to an ECS with a Few Clicks.

Constraints

  • There is no password complexity check that meets security requirements. No error message is displayed after an insecure password is entered.
  • Before using this API, you must install the password reset plug-in. For instructions about how to download and install the password reset plug-in, see "Installing the One-Click Password Reset Plug-in on an ECS" in the Elastic Cloud Server User Guide.
  • This API cannot detect whether the target ECS supports password reset.
  • If resetting the password for logging in to an ECS failed, this API will not report an error.
  • A new password takes effect after the ECS is started or restarted.

URI

PUT /v2.1/{project_id}/servers/{server_id}/os-reset-password

Table 1 lists the parameters.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the ID, see Obtaining a Project ID.

server_id

Yes

Specifies the ECS ID.

Request

Table 2 describes the request parameter.

Table 2 Request parameter

Parameter

Type

Mandatory

Description

reset-password

Object

Yes

Specifies the reset-password details. For details, see Table 3.

Table 3 reset-password field description

Parameter

Type

Mandatory

Description

new_password

String

Yes

Specifies the new password for logging in to the ECS.

This API does not check password security. Ensure that the password complexity complies with the password rules.

The password rules are as follows:

  • Consists of 8 to 26 characters.
  • Must contain at least three of the following character types:
    • Uppercase letters
    • Lowercase letters
    • Digits
    • Special characters, including !@$%^-_=+[{}]:,./?
  • Cannot contain the username or the username spelled backwards.
  • Cannot contain more than two characters in the same sequence as they appear in the username. (This requirement applies only to Windows ECSs.)

Response

None

Example Request

You are advised to store it in ciphertext in the configuration file or an environment variable and decrypt it when needed to ensure security.

PUT https://{endpoint}/v2.1/{project_id}/servers/{server_id}/os-reset-password
{
	"reset-password": {
		"new_password": "$ADMIN_PASS",
	}
}

Example Response

None

Error Codes

See Error Codes.