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 a
I had the same problem and didn't get it to work using the methods suggested in the other answers. What finally worked was to explicitly send in my "user" when copying the file as indicated in the official documentation. The important part being the "USER@" in
gcloud compute scp [[USER@]INSTANCE:]SRC [[[USER@]INSTANCE:]SRC …] [[USER@]INSTANCE:]DEST
In my case I could initially transfer files by typing:
gcloud compute scp instance_name:~/file_to_copy /local_dir
but after I got the permission denied I got it working by instead typing:
gcloud compute scp my_user_name@instance_name:~/file_to_copy /local_dir
where the username in my case was the one I was logged in to Google Cloud with.