Help Center/ Elastic Cloud Server/ User Guide/ Passwords and Key Pairs/ Password Reset/ Resetting the Password for Logging In to an ECS in the OS
Updated on 2024-11-14 GMT+08:00

Resetting the Password for Logging In to an ECS in the OS

Scenarios

This section describes how to reset the password for logging in to an ECS in the OS when the password is about to expire, the password is forgotten, or you are logging in to the ECS for the first time. It is a good practice to change the initial password upon the first login.

Prerequisites

The ECS can be logged in.

Background

Table 1 shows the ECS password complexity requirements.

Table 1 Password complexity requirements

Parameter

Requirement

Password

  • Consists of 8 to 26 characters.
  • Contains at least three of the following character types:
    • Uppercase letters
    • Lowercase letters
    • Digits
    • Special characters for Linux ECSs: !@%-_=+[]:./^,{}?
  • Cannot contain the username or the username spelled backwards.

Linux

  1. Use the existing key file to log in to the ECS as user root through SSH.

    For details, see Login Using an SSH Key.

  2. Run the following command to reset the password of user root:

    passwd

    To reset the password of another user, replace passwd with passwd username.

  3. Enter a new password that meets the requirements listed in Table 1 as prompted.
    New password:
    Retype new password:
    If the following information is displayed, the password has been changed:
    passwd: all authentication tokens updates successfully