Google Compute Engine: SSH-Error while trying to connect to an instance
<p>the last days I tried my hardest to get a ssh-connection running from my home computer to a Google compute engine instance, but couldn't make it happen. Unfortunately, the search results from the internet didn't helped my either, so I will ask you guys for help :). Every answer/suggestion is highly appreciated.</p>

<p>.</p>

<p><strong>My stats:</strong></p>

<p>Home-Computer:  </p>

<ul>
<li><p>OS is Windows 7</p></li>
<li><p>Home-Computer username is not the same as my Google cloud account name</p></li>
</ul>

<p>Google instance: </p>

<ul>
<li>n1-standard-1, europe-west1-b</li>
<li>OS: Debian GNU/Linux 8.3 (jessie)  [the default one]</li>
<li>External/Static IP: activated</li>
<li>Allowed HTTP traffic</li>
<li>Allowed HTTPS traffic</li>
</ul>

<p>Others:</p>

<ul>
<li><p>this is my first Google cloud experience</p></li>
<li><p>I'm still in my free trial period @ Google cloud plattform</p></li>
<li><p>I have Putty, Google SDK and Python 2.7 installed</p></li>
</ul>

<p>.</p>

<p><strong>What I did / tried so far:</strong></p>

<p>First I tried to connect to my instance using the Google shell with the command:</p>

<p><code>gcloud compute ssh instance_name --zone europe-west1-b</code></p>

<p>The shell asked me to generate shh-keys, I answered 'Yes', and I obtained a private + public key in my C:\Users\Lodrik.ssh\ directory. However, while trying to connected I got the error message: </p>

<blockquote>
  <p>Fatal Error: Disconnected: No supported authentication methods available
   (server sent: publickey)</p>
</blockquote>

<p>[Error_Pic][1] // sry, not working because I have &lt; 10 reputation points</p>

<p>.</p>

<p>Second, I thought there might be a problem because my user-name from my Google account and my home-pc's user name differ. Therefore, I tried to shh-conntect to my instance, using my home-pc username:</p>

<p><code>gcloud compute ssh  Lodrik@instance_name --zone europe-west1-b</code></p>

<p>As a results, I just got an error message (again -.-). However, this time it is was different one. A Putty shell opened with the message: </p>

<blockquote>
  <p>Using username "Lodrik". Server refused our key.</p>
</blockquote>

<p>[Error_Pic_2][2] // sry, not working because I have &lt; 10 reputation points</p>

<p>.</p>

<p>Finally, I searched at stackoverflow for my problem, and found this thread (similar question + answer): <a href="https://stackoverflow.com/questions/25784408/cannot-connect-to-compute-engine-instance-via-ssh">Cannot connect to Compute Engine instance via SSH</a> </p>

<p>Hence, I followed the steps from the thread's answer:</p>

<p>1) I added my public key (from ~/Lodrik/.shh/) manually via the Google cloud plattform's web-dashboard </p>

<p>2) I copied the shown username (from this added public key) and my instance's IP address and entered them into putty (as described in the answer)</p>

<p>3) I tried to connected to my instance via putty</p>

<p>As a result, a shell window opened and asked me for my login name. However, no matter what name I enter, I'll get the error message:</p>

<blockquote>
  <p>Server refused our key.</p>
</blockquote>

<p><a href="https://i.stack.imgur.com/LNgMe.png" rel="nofollow noreferrer">Error_Pic_3</a></p>

<p>.</p>

<p><strong>Questions:</strong></p>

<ul>
<li><p>Any ideas what I'm doing wrong?</p></li>
<li><p>Why do I have to add keys manually? Shouldn't that be automatic? </p></li>
</ul>

<p>.</p>

<p>Thank's a lot for your help. If you need any more information, please ask. I'll be happy to provide it for you :)</p>

<p>.</p>

<p><strong>Best regards,</strong></p>

<p><strong>Lodrik</strong></p>