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

StackOverflow https://stackoverflow.com/questions/22168003

  •  01-06-2023
  •  | 
  •  

質問

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.

役に立ちましたか?

解決 5

Well...

In the end, I had to delete all my keys, upload them again and wait a half an hour more or less. I don't know what happened but now it works again.

他のヒント

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.

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.

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.

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.

I was getting this error because of wrong userid. As soon as I used ec2-user it worked. I was under the impression that my AWS account id is my userid. It seems ec2-user is by default the user, you should login with.

Copy the content in your pem file and create another pem file and paste the content. Sounds lame... but it works !!

Just go to Putty keygen and load an existing private key from your local path where vagrant box for centos is installed (example :- ...vagrant\machines\default\virtualbox\private_key) and then choose SSH-1 (RSA) option from below and lastly click on "Save Private Key" button and save that file in your desktop or any where. Then open putty fill the ip address of machine -> go to SSH --> Auth -->Browse and provide the same key you have saved in your desktop or anywhere and then click on open.

I have the same issue and this is only because of Windows Defender. Just Goto RANSOMWARE Protection and allow your Know App like Putty or MoBaExtreme etc.

After trying almost everything, this solved the issue for me: I downloaded the latest version of PuTTYgen (0.77) and loaded the private key (.ppk) file. I then proceeded to [Save Private Key] and saved it under a different name.

This resolved the issue for me.

I had the same issue while connecting to openshift Labs. Stopped working for a new server. I had to Upload public key to OPENTLC again and it worked with the Putty

In PuTTY, under Category on the left, navigate to Connection → SSH → Auth.

On the right under Authentication parameters, click Browse and locate the private key saved from PuttyGen

I faced the same error and this is what worked for me.

  • In the Category pane, expand Connection, expand SSH, and then choose Auth.
  • Complete the following: Choose Browse. Select the .ppk file that you generated for your key pair and choose Open.

AWS Docs reference link: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

I am using CPanel and I forgot to authorize the key so it kept giving me that error..then I had some caffeine and realized I needed to authorize. Problem solved!

Restarting the machine and re-installing FileZilla and then connecting again solved my issue.

This issue I could resolve by using .ppk file instead of .pem file.

The above worked for me.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top