Google Cloud sdk shell

Google cloud sdk shell

Command to open the tunnel and connect to the VM instance
gcloud compute ssh myinstance --
Command to open the tunnel and a specific port to allow you to connect through the browser
gcloud compute ssh myinstance -- -L port:myinstance:port

Ex: gcloud compute ssh myinstance

Download files from gcloud
gcloud compute scp myinstance:/"File location"/"filename.gz" .
comments:

1) First navigate from your local machine where the file will be copied

2) "." means copy to this local or where I run this command. Otherwise you need to pass all path to where the file will be copied

Upload files to gcloud
gcloud compute scp "file name" myinstance:/home/mygclouduser/path

Comments