bumplzz69 / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

gcloud sdk for windows gives 'unknown option' when passing --ssh-flag with -P #136

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Install google-cloud sdk for Windows
2. Pass additional ssh options with --ssh-flag, for instance connecting to a 
different port:

     gcloud compute ssh instance-1 --zone us-central1-b --ssh-flag="-P 443"

Attaching screenshot of command and error.

What is the expected output? What do you see instead?

The ssh command should attempt to use the modified port, instead it gives the 
error:

     ssh: unknown option "-P 443"

This is not a connection refused or issue with connecting to the VM instance at 
all, and the ssh.exe command from gcloud sdk is reporting the error before even 
attempting to make a ssh connection.

What is the output of 'gcloud info'?
Google Cloud SDK [0.9.56]

Platform: [Windows, x86_64]
Python Version: [2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit 
(AMD64)]]
Site Packages: [Disabled]

Installation Root: [C:\Program Files\Google\Cloud SDK\google-cloud-sdk]
Installed Components:
  core: [2015.04.15]
  app-engine-python: [1.9.18]
  gsutil-win: [4.11]
  compute: [2015.04.14]
  gcutil-win: [1.16.5]
  gae-python: [2014.05.06]
  core-win: [2015.04.14]
  gcloud: [2015.04.14]
  windows-ssh-tools: [2015.04.14]
  app-engine-python-extras: [1.9.18]
  gae-python-launcher-win: [1.9.18]
  gsutil: [4.11]
  bq: [2.0.18]
  dns: [2015.04.14]
  sql: [2015.04.09]
  gcutil: [1.16.5]
  bq-win: [2.0.18]
System PATH: [C:\Program Files\Google\Cloud 
SDK\google-cloud-sdk\bin\..\bin\sdk;C:\python27_x64\;C:\Program 
Files\Google\Cloud 
SDK\google-cloud-sdk\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Google\Cloud 
SDK\google-cloud-sdk\bin;]
Cloud SDK on PATH: [True]

Installation Properties: [C:\Program Files\Google\Cloud 
SDK\google-cloud-sdk\properties]
User Config Directory: [C:\Users\playon\AppData\Roaming\gcloud]
User Properties: [C:\Users\playon\AppData\Roaming\gcloud\properties]
Current Workspace: [None]
Workspace Config Directory: [None]
Workspace Properties: [None]

Account: [ecliptik@gmail.com]
Project: [notional-armor-88114]

Current Properties:
  [core]
    project: [notional-armor-88114]
    account: [ecliptik@gmail.com]
    disable_usage_reporting: [True]

Logs Directory: [C:\Users\playon\AppData\Roaming\gcloud\logs]
Last Log File: 
[C:\Users\playon\AppData\Roaming\gcloud\logs\2015.04.26\20.27.42.379000.log]

Please provide any additional information below.

If given--ssh-flag-"--help" the option is passed and a list of arguments for 
ssh.exe is returned, which include -P for a different port (see attachment)

With --dry-run and --ssh-flag="-P 443" the command output is:

     C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\bin\sdk\ssh.EXE -i C:\Users\playon\.ssh\google_compute_engine -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no -P 443 user@146.147.52.43

This is a valid command, and if copy/pasted directly into the command line 
window without using gcloud ssh it works properly, connecting to the VM on a 
different port.

Original issue reported on code.google.com by eclip...@gmail.com on 27 Apr 2015 at 3:41

Attachments:

GoogleCodeExporter commented 9 years ago
This should work:

gcloud compute ssh instance-1 --zone us-central1-b --ssh-flag="-P" 
--ssh-flag="443"

Original comment by tovbinm@gmail.com on 3 Jun 2015 at 3:42

GoogleCodeExporter commented 9 years ago
SCP uses -P and ssh uses -p for port. Please try:

gcloud compute ssh instance-1 --zone us-central1-b --ssh-flag="-p443"

Let me know if that does not work for you.

Original comment by stephe...@google.com on 3 Jun 2015 at 2:21

GoogleCodeExporter commented 9 years ago
I tried 

gcloud compute ssh instance-1 --zone us-central1-b --ssh-flag="-P" 
--ssh-flag="443"

and it worked properly. It's a little confusing since I would think the 
--ssh-flag would accept a standard argument. I understand splitting up 
different arguments amongst mutliple --ssh-flag options (which is the case on 
Linux), but on Windows it's non-intuitive.

Thank you for the help.

Original comment by eclip...@gmail.com on 10 Jun 2015 at 3:28