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
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.
1) SSh into the vm by cloud console.
2) Change the root password sudo passwd
3) set below parameters to yes by nano /etc/ssh/sshd_config
PasswordAuthentication PermitRootLogin PasswordAuthentication
4) restart sshd service sshd restart
I have the same problem but found a workaround to connect via PuTTY manually.
For me the gcloud quick start had already:
C:\Users\USER_NAME\.ssh\
)Public Key - C:\Users\USER_NAME\.ssh\google_compute_engine.pub
Private Key - C:\Users\USER_NAME\.ssh\google_compute_engine.ppk
Add SSH key
link and click itgoogle_compute_engine.pub
into the field that appearsusername
External IP
above on the pageOpen 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
from above stepHope this helps. If someone has a solution for the gcloud issue I'd love to hear it too.
To get identified by ssh you need to run this command, which add gcloud ssh key in the list of ssh keys
ssh-add google_compute_engine C:\Users\USER_NAME\.ssh\
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.
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.