First open the "sshd_config" config file (/etc/ssh/sshd_config) en check these lines :
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 ⇒ need to be uncommented
After that restart sshd service : systemctl restart sshd.service
If /root/.ssh doens't existe create it : mkdir /root/.ssh
and then create the file "authorized_keys" file : touch /root/.ssh/authorized_keys
If /root/.ssh existe, then check if the "authorized_keys" file exist : ls -alh /root/.ssh/authorized_keys
And now put the public key inside this file and you can access your server with ssh key