vi /etc/ssh/sshd_config
查找RSAAuthentication、StrictModes、PubkeyAuthentication、AuthorizedKeysFile把所在行修改為:
RSAAuthentication yes StrictModes no PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys
重啟SSH服務
systemctl restart sshd.service
然后用xshell或者linux自己的keygen生成私鑰和公鑰,把公鑰拷貝到/root/.ssh/authorized_keys即可