登录到服务器切换到 root 用户 sudo su 修改 SSH 配置文件 vi /etc/ssh/sshd_config 修改以下内容 PermitRootLogin yes //默认为no,需要开启root用户访问改为yesStrictModes yesPasswordAuthentication yes //默认为no,改为yes开启密码登陆 重启 SSH 服务 systemctl restart sshd