【发布时间】:2015-03-04 14:43:20
【问题描述】:
我很难将文件复制到我的 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].
【问题讨论】:
-
您是否可以使用 gcloud compute ssh
命令从本地 OS X 机器 ssh 到您的实例? -
@Faizan 是的,我用过
gcloud compute --project "<PROJECT>" ssh --zone "us-central1-a" "<compute-name>" -
将
sudo添加到命令的开头是否可以正常工作? -
目标目录的权限似乎有问题,我认为解决方法是将文件复制到 /tmp 中的其他位置,然后将它们复制到 /var/www/html 时你 ssh 到实例。
标签: linux ubuntu permissions google-compute-engine gcloud