Site icon moneyslow.com

SSH 登录时出现如下错误:Disconnected:No supported authentication methods available

问题描述


当使用 SSH 登录云服务器 ECS (Elastic Compute Server) Linux 服务器时,即便正确输入了密码,也会出现类似如下错误信息:

  1. 通过 管理终端 进入系统。
  2. 通过 cat 等指令查看 /etc/ssh/sshd_config中是否包含类似如下配置:
  3. PasswordAuthentication
    							no
    								

    # 说明:该参数默认启用,默认值为 yes
    							
  4. 如果需要修改相关策略配置,在继续之前建议进行文件备份。
  5. 使用 vi 等编辑器,将参数值设置为 yes,或者整个删除或注释(在最开头添加 # 号)整行配置。比如:

    # PasswordAuthentication no
    							
  6. 使用如下指令重启 SSH 服务:

    service sshd restart
    							
  7. 再次尝试登录服务器。
Exit mobile version