Keep your password secure. Reset the password if:
This section describes how to reset the root password. After resetting the password, you can log in to the ECS and change the keys or reset passwords for non-root users.
Download the password reset script. Use a connection tool, such as WinSCP, to upload the obtained changepasswd.sh script to the temporary ECS.
To download WinSCP, log in at https://winscp.net/.
in the upper left corner and select a region and project.Do not forcibly stop the original ECS. Otherwise, password reset may fail.
fdisk -l
Figure 1 Viewing the directory of the system disk

chmod +x changepasswd.sh
./changepasswd.sh
When you run the password reset script, if the system displays a message indicating that there is no command related to logical volume manager (LVM), such as the message "no lvs command", install an LVM tool on the temporary ECS. The LVM2 tool is recommended, which can be installed by running the yum install lvm2 command.
If the original ECS and the temporary ECS both run CentOS 7, a mount failure may occur during script execution. To resolve this issue, replace mount $dev $mountPath with mount -o nouuid $dev $mountPath in the script.
If the following information is displayed, the password has been changed:
vi /etc/ssh/sshd_config
Modify the following settings:
Alternatively, uncomment PasswordAuthentication yes.
Alternatively, uncomment PermitRootLogin yes.
Search for AllowUsers in the file. If AllowUsers is missing, add AllowUsers root at the end of the file.