Cannot connect to Compute Engine instance via SSH

Cannot connect to Compute Engine instance via SSH



I've just created an instance using Google Cloud Platform's Compute Engine and tried to connect to it via SSH connection but it failed.



I'm following the quick start here.



I have generated the SSH key on my PC and have entered the pass-phrase when asked. Though I fail to succeed a log in :-(



I got the PuTTY SSH's error as below snapshots.



enter image description here



Then I get the PuTTY window inactive.



enter image description here




5 Answers
5



I have the same problem but found a workaround to connect via PuTTY manually.



For me the gcloud quick start had already:


C:UsersUSER_NAME.ssh



Public Key - C:UsersUSER_NAME.sshgoogle_compute_engine.pub



Private Key - C:UsersUSER_NAME.sshgoogle_compute_engine.ppk



enter image description here


Add SSH key


google_compute_engine.pub


username



enter image description here


External IP



Open PuTTY and paste the external IP into Host Name (port is the default of 22)



In the left hand nav expand: Connection -> SSH and then click Auth


username



Hope this helps. If someone has a solution for the gcloud issue I'd love to hear it too.






Thanks @scampsi. It works for me to connect manually.

– Nam G VU
Sep 12 '14 at 6:17






You're welcome. Good edit. Much clearer now.

– scampsi
Sep 12 '14 at 9:12



To get indentify by ssh you need to run this command, which add public key in the list of ssh keys:


ssh-add google_compute_engineC:UsersUSER_NAME.ssh






I had a problem in which using "gcloud compute ssh <instance-name>" I was able to connect, but when using just "ssh" I had to put the <location> and <project> is as well, so "ssh <instance-name>" would give me permission denied, but "ssh <instance-name>.<location>.<project-name>" would connect just fine. Nothing fixed it for me, except for this response, which was simply go to the ".ssh" folder, and run "ssh-add google_compute_engine" and now "ssh <instance-name>" works! Thanks a lot!

– bbkglb
Feb 22 '18 at 18:14



You can also connect to your VM instance using embedded in-browser SSH client, see here for how to do that. That's pretty much a couple of mouse click to do.



Not sure why, if the user already existed (eg: already SSH logged in google web console), it doesn't work when I manually added SSH keys into metadata on google web console. I have tried hundred of times from the steps below.



I found out you have to manually add your ssh key through web SSH CONSOLE -> ssh in on google web console and copy ssh pub key on your local machine (usually is in ~/.ssh/) and append (edit and paste to the end) it to ~/.ssh/authorized_keys.



A non-discussed answer is that you should have at least the standard memory on your VM instance (3.75GB) - do NOT use Micro VM instances.



I could only log in with SSH via browser console or gcloud command line, but not with Putty or Mac terminal SSH.
I spent an hour on the phone with support and we found this to be the problem.



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Crossroads (UK TV series)

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế