sudo passwd root
su – root
vi /etc/ssh/sshd_config
(取消以下部分前的#,获取改yes /no)
Port 22
AddressFamily any
ListenAddress 0.0.0.0
ListenAddress ::
PermitRootLogin yes
PasswordAuthentication yes
GSSAPIAuthentication no
然后重启服务
systemctl restart sshd