Noam Shvacher
Noam Shvacher

Reputation: 27

Cannot connect to Google Compute Instance user

I have searched all over google for this issue but found no answere yet, so I thought asking here.

I have a google compute instance and I had a running putty ssh connection that worked flawlessly. But after I formatted my PC, everything went wrong.

I installed gcloud and done the whole procces of ssh again (config-ssh, adding ssh to key list and trying to connect), also I was trying to connect to my old user after I realized that I typed a different name to my windows user name. Suddenly I got the No supported authentication message. So I thought something is wrong with the ssh keys, But I realized that I cannot connect to my user even through the google web browser window, the connection is always stuck on trying to connect until timeout.

I would gladly appreciate any help :)

Upvotes: 1

Views: 1502

Answers (2)

Valentin
Valentin

Reputation: 991

gcloud compute ssh currently has a known problem and might not work on Windows.

Here's a workaround until we fix it: run "gcloud compute ssh INSTANCE --dry-run". This will output the command it tries to execute. Copy that command. You can either add -W flag to it and run it, or replace ssh.exe with ssh-term.exe and remove the -o flags. If gcloud is installed in a place like Program Files, you might also need to add "" around the path.

Upvotes: 2

Adrián
Adrián

Reputation: 2880

First of all, run the following command (replacing the word in capital letters) which will ensure that your SSH key is created if it was not created before: gcloud compute ssh INSTANCE

Then, follow these steps to add your SSH key to your project and SSH into your instance:

1- Copy the content of C:\Users\<username>\.ssh\ google_compute_engine.pub(might be different path based on each Windows version) into the project metadata (Developers Console -> PROJECT -> Compute -> Metadata -> SSH keys -> Edit -> Add key).

If you want to log in as a different user, you can do it modifying it in the last word of the pasted text: <username>@<hostname>

2- Configure Putty. Go to Connection -> SSH -> Auth -> Browse and select your Putty SSH key which should be located in C:\Users\<username>\.ssh\ google_compute_engine.ppk)and try to SSH into the instance.

3- If it doesn't work, remove the instance metadata because the instance metadata overrides the project metadata. To do that, go to Compute-> Compute Engine-> INSTANCE -> SSH keys -> Edit -> Click on every ‘x’ and save the changes.

Regarding your issue trying to access using the SSH button in the Developers Console, I’d reboot the instance if it’s not in production because there is a script that must be working properly in order to access from there: /usr/bin/python /usr/share/google/google_daemon/manage_accounts.py --daemon

I hope it helps.

Upvotes: 0

Related Questions