gcloud cloud-shell ssh key file argument seems to be unusable

The man page for "gcloud cloud-shell ssh" says that I can specify a specific ssh key to log in. However, in the current CLI, this argument doesn't take a value.

 

```
--ssh-key-file
The path to the SSH key file. By default, this is
~/.ssh/google_compute_engine.
```

 


Attempts to use it causes an expected cli failure.

 

```
$ gcloud cloud-shell ssh --authorize-session --project myproject --ssh-key-file ~/.ssh/id_rsa
ERROR: (gcloud.cloud-shell.ssh) unrecognized arguments: /Users/sandip/.ssh/id_rsa

To search the help text of gcloud commands, run:
gcloud help -- SEARCH_TERMS
```

 

1 2 78
2 REPLIES 2

Hello @sandipb,

Welcome to Google Cloud Community!

The flag --ssh-key-file doesn't accept any value. You should add the SSH keys to VMs.

If the above option doesn't work, you can contact Google Cloud Support to further look into your case. Hope it helps, thanks!

Hi @Marramirez 
My point is that the description of that argument in the man page suggests that it is NOT a flag but an parameter which should take a value from the user otherwise default to ~/.ssh/google_compute_engine.

I know how to add keys to VMs, but this parameter seems like potentially useful for adding one off private keys to VMs.

What is the point of this flag otherwise?