All Products
Document Center

The error message "Disconnected: No supported authentication methods available" is displayed when you log on to a Linux instance through SSH

Last Updated: Sep 21, 2020

Disclaimer: This article may contain information about third-party products. Such information is for reference only. Alibaba Cloud does not make any guarantee, express or implied, with respect to the performance and reliability of third-party products, as well as potential impacts of operations on the products.


Problem description

When you log on to a Linux-based ECS instance through an SSH client and enter the correct account and password, the following errors occur.

  • Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
  • sshd[10826]: Connection closed by XX.XX.XX.XX.
  • Disconnected: No supported authentication methods available.



Parameters in the SSH servicePasswordAuthenticationThe default value of ISYes, And set its valueNoThis type of failure occurs because logon with a disabled password is verified. Need to be modifiedPasswordAuthenticationTo resolve this issue.



We recommend that you modify the configuration fileCreate a snapshotBack up data. This article takes CentOS 6.8 as an example.

  1. Connect and log on to a Linux instance. For more information about how to connect to a Linux instance, seeConnect to a Linux instance by using a management Terminal.
  2. Run the following command to view the SSH service configuration.
    cat /etc/ssh/sshd_config
    A similar output is displayed, indicating that the following configurations are included.
  3. Run the following command and pressIEdit the SSH service configuration file, and change the parametersPasswordAuthenticationSetYes, Or inPasswordAuthenticationAdd before parameter#, PressEscExit the editing mode and enter: WqSave the settings and exit.
    vi /etc/ssh/sshd_config 
    A similar output is displayed.
  4. Run the following command to restart NTP:

    Tips: If you are using an image of CentOS 7 or later, runSystemctl restart sshdCommand to restart the SSH service.

    service ssh restart
  5. Log on to the Linux instance again from the SSH client.



You can refer to the following documents to troubleshoot SSH client logon failures in detail.


Application scope

  • ECS