Help Center> Elastic Cloud Server> API Reference> APIs (Recommended)> Password Management> Resetting the Password for Logging In to an ECS with a Few Clicks

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

Function

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

Constraints

  • By default, 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 password reset plug-ins. For instructions about how to download and install the password reset plug-ins, see "Installing One-Click Password Reset Plug-ins" in Elastic Cloud Server User Guide.
  • You cannot determine whether an ECS supports password reset.
  • If the password reset function fails to take effect, this API does not report an error.
  • A new password takes effect after the ECS is started or restarted.

URI

PUT /v1/{project_id}/cloudservers/{server_id}/os-reset-password

Table 1 lists the URI 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 parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

reset-password

Yes

Object

Provides reset-password details.

Table 3 reset-password field description

Parameter

Mandatory

Type

Description

is_check_password

No

Boolean

Specifies whether to check password complexity.

new_password

Yes

String

Specifies the new password for logging in to an ECS.

By default, this API does not check password security. To check password security, set is_check_password to true.

A new password must comply with the following rules:
  • Consists of 8 to 26 characters.
  • Supports the following characters: !@%-_=+[]:./?
  • Cannot contain Chinese characters or the following characters: ¥—— ·~`#&^,{}*();"'<>|\ $
  • Contains at least three of the following: uppercase letters, lowercase letters, digits, and allowed special characters.
  • Cannot contain username Administrator/root or the username spelled backwards.
  • Cannot contain three consecutive characters in username Administrator

Response

None

Example Request

PUT https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/os-reset-password
{
	"reset-password": {
		"new_password": "Fusion@123"
	}
}

Example Response

None

Error Codes

See Error Code Description.