服务器去除秘钥连接,账号密码连接

  1. 使用root身份编辑云服务器的ssh登录方式。

    su root

    vi /etc/ssh/sshd_config

    修改如下配置项:

    • 把PasswordAuthentication no 改为 PasswordAuthentication yes

      或去掉PasswordAuthentication yes 前面的#注释掉。

    • 把PermitRootLogin no 改为 PermitRootLogin yes

      或去掉PermitRootLogin yes 前面的#注释掉。

  2. 重启sshd使修改生效。

    service sshd restart

posted @ 2022-08-11 18:49  码海兴辰  阅读(29)  评论(0)    收藏  举报