touch ~/.ssh/authorized_keys
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/id_rsa
chmod 700 ~/.ssh/
vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes #key登录方式
PermitRootLogin yes
PasswordAuthentication yes #密码登录方式
systemctl restart sshd