设置root密码
sudo passwd root
su root修改sshd_config
vim /etc/ssh/sshd_config
#Port 22 开启22端口或修改为其他端口
#PermitRootLogin yes 允许root用户登录
#PasswordAuthentication yes 允许密码登录
#PubkeyAuthentication yes 允许公钥登录修改authorized_keys
vim /root/.ssh/authorized_keys
#添加公钥内容重启sshd服务
service sshd restart