The newly installed centOS server is generally not allowed to remotely use the root user's home password to connect. This is also for security reasons, and a little configuration is required. (Of course also applies to cloud servers)
1. Login
If the centos machine is newly installed, you can log in directly as the root user; if it is a cloud server, you need to log in to the backend of the cloud server, use the web version of ssh to log in as the root user, and the following operations are the same.
2. Modify sshd_config
1. Open the configuration file
vi /etc/ssh/sshd_config
2. Modify the configuration, find these two configuration parameters, open the comment (delete "#"), and set it to "yes"
PermitRootLogin yes
PasswordAuthentication yes
3. Restart the ssh service
systemctl restart sshd