开启root帐号
sudo passwd root

vim /etc/ssh/sshd_config
PermitRootLogin yes

PasswordAuthentication yes #密码登录需要打开这个选项

systemctl restart sshd


#命令行打开root远程登录
sed -i '/PermitRootLogin /c PermitRootLogin yes' /etc/ssh/sshd_config
systemctl restart sshd

修改root密码

passwd root