[英]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.