I use gcloud cloud-shell ssh to connect to Google Cloud Shell. However, this spawns a new window, (PuTTY) which bothers me. Is there a way (some -- flag / &c.) to use it from the same console window?
Thanks in advance!
I use gcloud cloud-shell ssh to connect to Google Cloud Shell. However, this spawns a new window, (PuTTY) which bothers me. Is there a way (some -- flag / &c.) to use it from the same console window?
Thanks in advance!
The CLI is just a wrapper for launching Putty (on Windows) with the correct command line options. The SSH functionality is not built into gcloud.
Using --command flag, you can run the command on the virtual machine without opening new console window.
gcloud compute ssh your-instance --zone=your-zone --command="ps aux"
It runs the command on the target instance and then exits.
Use gcloud compute ssh --help command to learn more.