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

前端 未结 7 1972
滥情空心
滥情空心 2020-12-04 22:24

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

7条回答
  •  余生分开走
    2020-12-04 22:49

    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.

提交回复
热议问题