简体   繁体   English

如何将文件从谷歌云计算引擎(linux 终端)复制到谷歌云 shell?

[英]How can I copy files from a Google Cloud Compute engine(linux terminal) to google cloud shell?

I'm trying to transfer files stored in the google compute engine linux terminal to the google cloud shell. Is there a command line to do this?我正在尝试将存储在谷歌计算引擎 linux 终端中的文件传输到谷歌云 shell。是否有命令行可以执行此操作?

Yes you can do that from Cloud Shell. use the scp command (ssh cp)是的,您可以从 Cloud Shell 执行此操作。使用scp命令 (ssh cp)

gcloud compute scp <instance name>:<file or dir to get> <destintation> --zone <Zone of the instance>

Of course, the port 22 must be open to inte.net (firewall rule with 0.0.0.0/0 on port 22) and you must have the required permission to log into the VM当然,端口 22 必须对 inte.net 开放(端口 22 上具有 0.0.0.0/0 的防火墙规则)并且您必须具有登录 VM 所需的权限


EDIT 1编辑 1

You can perform the same operation from your environment with gcloud CLI.您可以使用 gcloud CLI 从您的环境中执行相同的操作。 The command is this one命令是这个

gcloud cloud-shell scp localhost:<Local files> cloudshell:<Cloud shell dir>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用 Cloud SQL 代理从 Google Compute Engine 连接到 Google Cloud SQL - Can't connect to Google Cloud SQL from Google Compute Engine with Cloud SQL Proxy 如何从 Google Cloud Shell 保存终端文本? - How to Save Terminal Text from Google Cloud Shell? 无法使用 sshtunnel 将 SSH 发送到 Google Cloud Compute Engine - Can't SSH to Google Cloud Compute Engine with sshtunnel 谷歌云计算引擎 http 连接超时 - Google Cloud Compute Engine http Connection Timeout 无法访问谷歌云计算引擎上的 Jenkins - Unable to access Jenkins on compute engine on google cloud 如何使 ssh 从谷歌计算引擎隧道连接到数据库服务器,并尝试从谷歌云运行连接 - How to make ssh tunneling from google compute engine to database server, and try to connect from google cloud run 如何在 Google Cloud Compute Engine 实例上轮换临时 IP? - How do I rotate ephemeral IP on Google Cloud Compute Engine instance? 来自计算引擎的谷歌云平台免费套餐限制 - Google cloud platform free tier limits from compute engine 如何将现有的 Compute Engine 用于 Google Cloud Build? - How to use existing Compute Engine for Google Cloud Build? 如何将数据从 Google Cloud VM 迁移到 Google Kube.netes Engine? - How to migrate data from Google Cloud VM to Google Kubernetes Engine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM