使用管理权限打开文件并更改以下行:/etc/ssh/sshd_config
#PermitRootLogin prohibit-password
PermitRootLogin yes
sed命令修改
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
重新启动 SSH 服务
sudo systemctl restart ssh
激活root用户
sudo passwd
[sudo] password for mylinuxuser:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully