Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disconnected: no supported authentication methods available (server sent: publickey, gssapi-with-mic)

Tags:

ssh

putty

I don't know what is happening.

I have been able to connect to the server for a couple of days without problems and suddendly I got a frozen window using putty. After that, each time I try to connect, I receive this message:

disconnected: no supported authentication methods available (server sent: publickey, gssapi-with-mic)

I am using putty and puttyagent for private key. I already have uploaded the public key to the server and I was able to connect half an hour ago.

How can I check why it is failing? I haven't change the user or password or anything.

like image 327
Biribu Avatar asked Mar 04 '14 09:03

Biribu


People also ask

How do I disable Gssapi microphone?

Steps to disable or enable GSSAPI authentication in SSH:Open SSHd configuration file using your favorite text editor. $ sudo vi /etc/ssh/sshd_config [sudo] password for user: Search for GSSAPIAuthentication directive and set the value to no to disable GSSAPIAuthentication authentication method or yes to enable.


4 Answers

I had a similar issue:

  • in putty console, I got the message saying "Server refused our key"
  • windows error message was: "PuTTY Fatal Error" - "No supported authentication methods available (server sent: public key,gssapi-keyex,gssapi-with-mic)"

see the screenshot of error message here

I was able to connect to EC2 via PowerShell successfully (with .pem file) so I realized that .ppk file was wrong.

Googled for about an hour and find that when you generate the .ppk with PuTTYgen for the first time you'll see the key comment filed something like "rsa-key-20191006" and what should be there is "imported-openssh-key".

After I loaded the same .pem file, as for the first time (but DID NOT CLICK on Generate) and clicked Save Private Key and used this private key for Auth, everything worked as expected.

like image 178
Verica Milanovic Avatar answered Sep 26 '22 07:09

Verica Milanovic


I got the same error disconnected: no supported authentication methods available (server sent: publickey, gssapi-with-mic) while trying to connect to an AWS EC2 instance with ssh using a PPK. The issue I had and fixed was that when I used PuTTYKeyGenerator to convert from PEM to PPK, by default it uses PPK file version 3 which is not supported by AWS EC2 and when I tried to connect with mRemoteNG I got the error, then I tried directly with PuTTYNG I got PuTTY key format too new:

enter image description here

To make it work, change in PuTTYKeyGenerator >> Key >> Parameters for saving key files >> PPK file version: 2 and then reconvert the PPK and should work.

like image 36
m4rccc Avatar answered Sep 24 '22 07:09

m4rccc


I had the same issue after creating a Centos 7 vm using Vagrant. In the sshd_config file it said "PasswordAuthentication no". Changing that to "PasswordAuthentication yes" and a restart of sshd solved it for me.

like image 40
Jelle de Bruin Avatar answered Sep 23 '22 07:09

Jelle de Bruin


In my case updating both putty and puttygen to the latest version (0.76) solved this issue.

  1. Download latest putty and latest puttygen from https://www.puttygen.com/#Download_PuTTYgen_on_Windows
  2. In puttygen click Load, chose All Files and select your PEM file for your EC2 instance.
  3. Choose SSH-1 (RSA) as a type of key to generate. enter image description here
  4. Click on Save private key.
  5. In putty in the Auth section click on browse and select your generated private key.
like image 44
Michał Stochmal Avatar answered Sep 25 '22 07:09

Michał Stochmal