15

I have encountered this kind of infamous "Waiting for SSH key to propagate." phrase in at least two cases:

  • Connecting to a virtual box via browser
  • Creating new DataLab instance

The question I have is - what happens and what makes it take so long? Is there any way around it, especially for DataLab?

Even if there is no solution, I would like to understand why it is so time consuming.

Marcin
  • 4,080
  • 1
  • 27
  • 54
  • 1
    What do you mean by "taking so long"? what do you see on your screen? and does it eventually proceed? – maininformer Jan 14 '19 at 23:07
  • Few minutes or more. Sometimes I do not have enough time to wait for it to complete so I do not know if it succeeds (but usually does). – Marcin Jan 15 '19 at 15:50
  • I could not reproduce this yesterday. So I am trying to understand what you are seeing. When you say "creating a new datalab instance", I am assuming you mean creating a local proxy for your browser is that correct? -- you run the command it says propagating SSH keys and then it freezes? or does it eventually end and you see something? – maininformer Jan 15 '19 at 15:54
  • 1
    It ususally completes succesfully but it takes quite a lot of time for such seemingly simple operation. – Marcin Jan 15 '19 at 16:39
  • I have a few questions for you to clarify: 1. Are you still experiencing this issue? 2. Does it affect your other VMs or just your datalab VMs? 3. Can you time how long it takes to connect to a Datalab VM or create a Datalab instance? I was unable to reproduce the error when I created a datalab instance or ssh into the VM. – Patrick W Jun 26 '19 at 20:37
  • I observed the same symptom and eventually timing out, in case of the compute instance access is blocked by the firewall from n/w I was trying to connect to it. – Sridivakar Jan 05 '21 at 04:12

1 Answers1

4

GCP offers multiple way to login into your system through ssh. These are :

  • Through UI button which opens a browser based connection (pretty common)
  • Through command line utility gcloud
  • Pre-configured ssh-keys by users through ssh-client in our local terminal using a private key.

Generally, the third step is the fastest way but people often use first and second because of the ease of the utility provided by Google.

Now, the first and second steps are also fast but sometime it takes more time because during first and second steps google does following things:

      1. Create a secured ssh-key for you
      2. Create a secure session for browser interaction
      3. Waiting for the ssh keys to propagate from the system to the browser connection  
      4. Giving User the secured shell to work with 

Sometime it happens fast but sometime, it takes time because of network routing and connectivity. Hope this explain as I derived this inference by reading the documentation and working on GCP for long time.!!