[ssh] Google server putty connect 'Disconnected: No supported authentication methods available (server sent: publickey)

I'm trying to connect to my Debian Google Compute Engine server through PuTTy (I've tried other alternatives too) but when I do I get the error "Disconnected: No supported authentication methods available (server sent: publickey)

The google server came without a username and password, only a url to automatically login to their own terminal.

The answer is


Please follow this guide: https://gist.github.com/feczo/7282a6e00181fde4281b with pictures.

In short:

Using Puttygen, click 'Generate' move the mouse around as instructed and wait

  • Enter your desired username

  • Enter your password

  • Save the private key

Copy the entire content of the 'Public key for pasting into OpenSSH authorized_keys file' window. Make sure to copy every single character from the beginning to the very end!

Go to the Create instances page in the Google Cloud Platform Console and in the advanced options link paste the contents of your public key.

Note the IP address of the instance once it is complete. Open putty, from the left hand menu go to Connection / SSH / Auth and define the key file location which was saved.

From the left hand menu go to Connection / Data and define the same username

  • Enter the IP address of your instance
  • name the connection below saved Sessions as 'GCE' click on 'Save'
  • double click the 'GCE' entry you just created
  • accept the identy of the host

Now login with the password you specified earlier and run sudo su - and you are all set.


I know this is an old question, but I had the same problem and solved it thanks to this answer.

I use Putty regularly and have never had any problems. I use and have always used public key authentication. Today I could not connect again to my server, without changing any settings.

Then I saw the answer and remembered that I inadvertently ran chmod 777 . in my user's home directory. I connected from somewhere else and simply ran chmod 755 ~. Everything was back to normal instantly, I didn't even have to restart sshd.

I hope I saved some time from someone


For me these was my problem, solution from https://unix.stackexchange.com/questions/282908/server-refused-public-key-signature-despite-accepting-key-putty

"Looking at the log /var/log/secure showed that it was just downright refused. I'm somewhat new to centos since I'm mainly a debian kind of guy, so I was unaware of /var/log/secure

After checking this and doing a bit of searching, it turns out PermitRootLogin no needs to be PermitRootLogin without-password if you want to specifically use just keys for root login. That did the trick. Thanks everyone for contributing."


Electricity went down and got this error. Solution was to double click your .ppk (Putty Private Key) and enter your password.


I had the same problem but got it working by changing enable-oslogin from TRUE to FALSE in google cloud.

from:

to: enter image description here


I faced the same issue and solve after several trial and error. In the /etc/ssh/ssh_config, set

  • PubkeyAuthentication yes

  • AuthorizedKeysFile .ssh/authorized_keys

  • PasswordAuthentication no

  • AuthenticationMethods publickey

then, open putty. In the "Saved Sessions", enter the server IP, go through the path Connection->SSH->Auth->Browse on the left panel to search your private key and open it. Last but not least, go back to Session of putty on the left panel and you can see the server IP address is still in the field, "Saved Sessions", then click "Save", which is the critical step. It will let the user login without password any more. Have fun,


PasswordAuthentication and ChallengeResponseAuthentication default set to NO in rhel7.

Change them to NO and restart sshd.


This problem mainly caused by your connected username not have the access to the shell in GCE. So you use the following steps to solve this issue.

gcloud auth list

If you are using the correct login. please follow the below steps. otherwise use

gcloud auth revoke --all
gcloud auth login [your-iam-user]

and you get the token or it automatically detect the token.

gcloud compute --project "{projectid}" ssh --zone "{zone_name}" "{instance_name}" .

if you dont know this above line click to compute engine-> ssh dropdown arrow-> view google command-> copy that code and use it

Now it update your metadata and it is available in your computer's folder Users->username

~/.ssh/google_compute_engine.ppk
~/.ssh/google_compute_engine.pub

Then you create a new ppk file using puttygen and you give the username, which you want like my_work_space. Then save the publickey and privatekey in a folder.

Next step: Copy the public key data from puttygen and create new ssh key in gcloud metadata

cloud console ->compute engine->metadata->ssh key->add new item->paste the key and save it

and now return your shell commandline tool then enter

sudo chown -R my_work_space /home/my_work_space

now you connect this private key using sftp to anywhere. and it opens the files without showing the permission errors

:) happy hours.


You need to use an SSH key to login to your instance.

The GCE documentation explains the process here.


I had the same issue and just figured it out !!

Assuming that you already went and created private/public key added your public key on the remote server ... type in [email protected] and THEN go to Connection -> SSH -> Auth and click Browse to locate your private key. After you choose it will populate the input field. After that click OPEN ...

So the important thing here is the order... make sure you first enter parameters for the host and then locate your private key.


Similar problem - same error message. I got the same message when trying to clone something from bitbucket with ssh. The problem was in my ssh configuration configured in the mercurial.ini: I used the wrong bitbucket username. After I corrected the user name things worked.


Apparently running sudo chmod -R a+rw on your home folder causes this to happen as well.


If the private key has been generated with ssh-keygen in Linux it needs to be converted with puttygen because Putty does not support openssh keys.

Start puttygen, and click on Conversions - Import key, then click Browse and select the private key generated with openssh, then click on Save private key.

Use your new key to connect.


Download "PuttyGEN" get publickey and privatekey use gcloud SSH edit and paste your publickey located in /home/USER/.ssh/authorized_keys

sudo vim ~/.ssh/authorized_keys

Tap the i key to paste publicKEY. To save, tap Esc, :, w, q, Enter. Edit the /etc/ssh/sshd_config file.

sudo vim /etc/ssh/sshd_config

Change

PasswordAuthentication no [...] ChallengeResponseAuthentication to no. [...] UsePAM no [...] Restart ssh

/etc/init.d/ssh restart.

the rest config your putty as tutorial NB:choose the pageant add keys and start session would be better


I got this error because I had forgotten to add my username behind the key in the GCE metadata section. For instance, you are meant to add an entry into the metadata section which looks like this:

sshKeys    username:key

I forgot the username: part and thus when I tried to login with that username, I got the no supported auth methods error.

Or, to turn off the ssh key requirement entirely, check out my other answer.


I had PuTTY working and then one day got this error.

Solution: I had revised the folder path name containing my certificates (private keys), and this caused Pageant to lose track of the certificates and so was empty.

Once I re-installed the certificate into Pageant then Putty started working again.


Turn on Password Authentication

By default, you need to use keys to ssh into your google compute engine machine, but you can turn on password authentication if you do not need that level of security.

Tip: Use the Open in browser window SSH option from your cloud console to gain access to the machine. Then switch to the root user with sudo su - root to make the configuration changes below.

enter image description here

  1. Edit the /etc/ssh/sshd_config file.
  2. Change PasswordAuthentication and ChallengeResponseAuthentication to yes.
  3. Restart ssh /etc/init.d/ssh restart.

Examples related to ssh

Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058" How to solve "sign_and_send_pubkey: signing failed: agent refused operation"? key_load_public: invalid format ssh connection refused on Raspberry Pi Getting permission denied (public key) on gitlab Verify host key with pysftp Can't connect to Postgresql on port 5432 Checkout Jenkins Pipeline Git SCM with credentials? How to open remote files in sublime text 3 how to setup ssh keys for jenkins to publish via ssh

Examples related to google-cloud-platform

GoogleMaps API KEY for testing How to change the project in GCP using CLI commands Enabling CORS in Cloud Functions for Firebase Get root password for Google Cloud Engine VM gcloud command not found - while installing Google Cloud SDK What is the difference between Google App Engine and Google Compute Engine? How to open a specific port such as 9090 in Google Compute Engine Google server putty connect 'Disconnected: No supported authentication methods available (server sent: publickey) How to use Google App Engine with my own naked domain (not subdomain)?

Examples related to debian

E: Unable to locate package npm How to update-alternatives to Python 3 without breaking apt? What is difference between arm64 and armhf? github: server certificate verification failed "Call to undefined function mysql_connect()" after upgrade to php-7 Debian 8 (Live-CD) what is the standard login and password? How to set the locale inside a Debian/Ubuntu Docker container? ps command doesn't work in docker container Forwarding port 80 to 8080 using NGINX Switching users inside Docker image to a non-root user

Examples related to google-compute-engine

What is the difference between Google App Engine and Google Compute Engine? How to open a specific port such as 9090 in Google Compute Engine Google server putty connect 'Disconnected: No supported authentication methods available (server sent: publickey) Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

Examples related to putty

Forward X11 failed: Network error: Connection refused Best way to script remote SSH commands in Batch (Windows) AWS - Disconnected : No supported authentication methods available (server sent :publickey) Change mysql user password using command line How to download a file from my server using SSH (using PuTTY on Windows) Using putty to scp from windows to Linux Saving the PuTTY session logging Putty: Getting Server refused our key Error Google server putty connect 'Disconnected: No supported authentication methods available (server sent: publickey) Batch file for PuTTY/PSFTP file transfer automation