Althogh OP found a solution, I would like to write down my solution to a similar problem in the hope that it will be useful to those who look like a similar problem and achieve this answer.
The reason for my problem is that the .ssh directory in the user's home folder on the CentOS server was not set properly after the useradd command created it.
In addition, I need to manually set the .ssh folder mode with the following commands:
chmod gw /home/user
chmod 700 /home/user/.ssh
chmod 600 /home/user/.ssh/authorized_keys
ZJ Lyu
source share