Keep your password secure. Reset the password if:
This section describes how to reset the password of user root. After resetting the password, you can log in to the ECS, and change the private key or reset the password of a non-root user.
Contact customer service to obtain 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
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.
set password success.
vi /etc/ssh/sshd_config
Modify the following parameters:
Alternatively, delete the comment tag (#) before PasswordAuthentication yes.
Alternatively, delete the comment tag (#) before PermitRootLogin yes.
Search for AllowUsers in the file. If AllowUsers is unavailable, add it at the end of the file.