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

标签 linux ubuntu permissions google-compute-engine gcloud

我很难将文件复制到我的 Google Compute Engine。我在 Google Compute Engine 上使用 Ubuntu 服务器。

我正在从我的 OS X 终端执行此操作,并且我已经获得使用 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].

最佳答案

在实例名前插入root@:

local:$ gcloud compute copy-files /Users/Bryan/Documents/Websites/gce/index.php root@example-instance:/var/www/html --zone us-central1-a

关于linux - `gcloud compute copy-files` : permission denied when copying files,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27807018/

相关文章:

php - php-fpm 在 docker 中运行或不在 docker 中运行的用户是什么?

javascript - Facebook JS API : Not receiving user email despite asking for permissions

ubuntu - 如何使用wsl向ubuntu上的文件添加权限?

linux - 如何分析 NetPIPE 基准测试的结果

php - 如何在服务器中安装钩子(Hook)?

linux - .c.s : in linux-0. 11 生成文件

ubuntu - 复制现有的 K8s Pod

java - 如何通过ubuntu终端将写在.txt中的参数传递给java程序?

android - 在 Android 中以 root 权限运行应用程序

linux - 如何仅在 awk 中的某些列上运行 if 条件