Skip to content
Advertisement

`gcloud compute copy-files`: permission denied when copying files

I’m having a hard time copying files over to my Google Compute Engine. I am using an Ubuntu server on Google Compute Engine.

I’m doing this from my OS X terminal and I am already authorized using gcloud.

local:$ gcloud compute copy-files /Users/Bryan/Documents/Websites/gce/index.php example-instance:/var/www/html --zone us-central1-a
Warning: Permanently added '<IP>' (RSA) to the list of known hosts.
scp: /var/www/html/index.php: Permission denied
ERROR: (gcloud.compute.copy-files) [/usr/bin/scp] exited with return code [1].

Advertisement

Answer

insert root@ before the instance name:

local:$ gcloud compute copy-files /Users/Bryan/Documents/Websites/gce/index.php root@example-instance:/var/www/html --zone us-central1-a
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement