这篇文章上次修改于 1669 天前,可能其部分内容已经发生变化,如有疑问可询问作者。
  • 进入云服务器实例面板

    从云服务器实例面板的 SSH 连接服务器

    • 切换到root角色
sudo -i

  • 修改SSH配置文件/etc/ssh/sshd_config

    修改PermitRootLogin和PasswordAuthentication为yes

# Authentication:
PermitRootLogin yes //默认为no,需要开启root用户访问改为yes
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes //默认为no,改为yes开启密码登陆
  • 给root用户设置密码
passwd root
  • 重启SSH服务使修改生效
/etc/init.d/ssh restart