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/.
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 (such as "no lvs command"), indicating that there is no command related to logical volume manager (LVM), you need to install an LVM tool (lvm2 recommended) on the temporary ECS by running the following command:
yum install lvm2
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.