Reputation: 3
I'm trying to transfer files stored in the google compute engine linux terminal to the google cloud shell. Is there a command line to do this?
Upvotes: 0
Views: 537
Reputation: 75715
Yes you can do that from Cloud Shell. use the scp
command (ssh cp)
gcloud compute scp <instance name>:<file or dir to get> <destintation> --zone <Zone of the instance>
Of course, the port 22 must be open to internet (firewall rule with 0.0.0.0/0 on port 22) and you must have the required permission to log into the VM
EDIT 1
You can perform the same operation from your environment with gcloud CLI. The command is this one
gcloud cloud-shell scp localhost:<Local files> cloudshell:<Cloud shell dir>
Upvotes: 1