打开SSH配置文件/etc/ssh/sshd_config并编辑该文件
  vi /etc/ssh/sshd_config

查找并修改以下两行内容(如果不存在则添加):
  PermitRootLogin yes
  PasswordAuthentication yes
注:将PermitRootLogin设为"yes"表示允许通过SSH登录到Root账户;

       将PasswordAuthentication设为"yes"表示允许密码验证。

按esc输入:wq保存更改后重新启动SSH服务:
      systemctl restart ssh

image.png