Search code examples
putty

SSH PuTTy error Unable to open address shell


I run the command "gcloud alpha cloud-shell ssh" on google cloud sdk shell in window 7 32bit.But I always get errors

enter image description here

What do I need to do or have something I can do to fix it please help me


Solution

  • It looks like a problem with putty.exe on Windows. The Windows version of putty does not like the command line options that gcloud is generating.

    To get around this type this command:

    gcloud alpha cloud-shell ssh --dry-run
    

    This will print the command line to run putty.exe. It looks like this:

    'C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\sdk\putty.exe' -t -P 6000 -i 'C:\Users\username\.ssh\google_compute_engine.ppk' username@devshell-vm-12345678-1234-4992-8505-01234567890ab.cloudshell.dev 'DEVSHELL_PROJECT_ID=development-12345 bash -l'
    

    Copy that command line and replace single quotes with double quotes and delete the part that ends with 'DEVSHELL_PROJECT_ID=development-12345 bash -l' as this is the part causing a problem on Windows.

    Example:

    "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\sdk\putty.exe" -t -P 6000 -i "C:\Users\username\.ssh\google_compute_engine.ppk" username@devshell-vm-12345678-1234-4992-8505-01234567890ab.cloudshell.dev
    

    Second Method:

    You can also start putty.exe manually and then fill in the options in the GUI.

    The SSH port is 6000

    The example above shows you the putty ssh private key:

    C:\Users\username\.ssh\google_compute_engine.ppk
    

    The example above shows you the hostname:

    devshell-vm-12345678-1234-4992-8505-01234567890ab.cloudshell.dev