What should I do if the error "No supported authentication methods available" is displayed?
This article describes the cause and solution of the error "No supported authentication methods available (server sent: publickey,gssapi-keyex,gssapi-with-mic)" displayed when using a third-party SSH client to remotely connect to a Linux instance.
When you use a third-party SSH client to remotely connect to the ECS instance of the Linux system, you have entered the correct account number and password, but an error message similar to the following still appears.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
sshd[10826]: Connection closed by XX.XX.XX.XX
No supported authentication methods available (server sent: publickey,gssapi-keyex,gssapi-with-mic)
This problem may occur when you log in with a password or key, and the details are as follows:
• This problem occurs when using a password to log in: It may be that the ECS instance prohibits users from using a password to connect. You can change the value of the PasswordAuthentication parameter to yes to solve this problem.
• This problem occurs when using a key to log in: it may be that the public key of the SSH key pair is not added to the corresponding user .ssh/authorized_keys. You can re-upload the public key to the authorized_keys file to solve this problem.
1. Log in to the ECS instance using VNC.
2. Check whether the configuration of the parameter PasswordAuthentication in /etc/ssh/sshd_config is wrong.
cat /etc/ssh/sshd_config
If the PasswordAuthentication parameter is set to no, it means that password login is prohibited and needs to be changed to yes.
3. Modify the parameters of PasswordAuthentication
PasswordAuthentication is yes.
1) Open the SSH configuration file.
vi /etc/ssh/sshd_config
2) Change PasswordAuthentication no to PasswordAuthentication yes.
3) Press the Esc key and enter: wq to save the modification.
4. Execute the following command to restart the SSH service.
systemctl restart sshd.service
5. Reconnect to the Linux instance remotely to ensure that it can be connected normally.
1. Log in to the ECS instance using VNC.
2. Execute the following command to open the authorized_keys file.
vim /home/user/.ssh/authorized_keys
illustrate
Please replace /home/user with the actual user.
3. Press the i key to enter the editing mode.
4. Paste the locally saved public key into the authorized_keys file
5. Press the Esc key and enter: wq to exit the editing mode.
6. Re-use the key to log in to the ECS instance to ensure that no errors will occur again.
Problem phenomenon
When you use a third-party SSH client to remotely connect to the ECS instance of the Linux system, you have entered the correct account number and password, but an error message similar to the following still appears.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
sshd[10826]: Connection closed by XX.XX.XX.XX
No supported authentication methods available (server sent: publickey,gssapi-keyex,gssapi-with-mic)
Problem causes
This problem may occur when you log in with a password or key, and the details are as follows:
• This problem occurs when using a password to log in: It may be that the ECS instance prohibits users from using a password to connect. You can change the value of the PasswordAuthentication parameter to yes to solve this problem.
• This problem occurs when using a key to log in: it may be that the public key of the SSH key pair is not added to the corresponding user .ssh/authorized_keys. You can re-upload the public key to the authorized_keys file to solve this problem.
Solution 1: Allow password login
1. Log in to the ECS instance using VNC.
2. Check whether the configuration of the parameter PasswordAuthentication in /etc/ssh/sshd_config is wrong.
cat /etc/ssh/sshd_config
If the PasswordAuthentication parameter is set to no, it means that password login is prohibited and needs to be changed to yes.
3. Modify the parameters of PasswordAuthentication
PasswordAuthentication is yes.
1) Open the SSH configuration file.
vi /etc/ssh/sshd_config
2) Change PasswordAuthentication no to PasswordAuthentication yes.
3) Press the Esc key and enter: wq to save the modification.
4. Execute the following command to restart the SSH service.
systemctl restart sshd.service
5. Reconnect to the Linux instance remotely to ensure that it can be connected normally.
Solution 2: Copy the public key to the authorized_keys file
1. Log in to the ECS instance using VNC.
2. Execute the following command to open the authorized_keys file.
vim /home/user/.ssh/authorized_keys
illustrate
Please replace /home/user with the actual user.
3. Press the i key to enter the editing mode.
4. Paste the locally saved public key into the authorized_keys file
5. Press the Esc key and enter: wq to exit the editing mode.
6. Re-use the key to log in to the ECS instance to ensure that no errors will occur again.
Related Articles
-
A detailed explanation of Hadoop core architecture HDFS
Knowledge Base Team
-
What Does IOT Mean
Knowledge Base Team
-
6 Optional Technologies for Data Storage
Knowledge Base Team
-
What Is Blockchain Technology
Knowledge Base Team
Explore More Special Offers
-
Short Message Service(SMS) & Mail Service
50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00