gcloud compute execute command remotely

前端 未结 3 571
一生所求
一生所求 2021-02-01 16:21

Currently, if I want to execute something on a VM, I copy files over like this:

gcloud compute --project  copy-files --zone  /         


        
3条回答
  •  轮回少年
    2021-02-01 17:20

    Did it with a bit of a tangent; using the normal ssh client instead of gcloud compute:

    ssh -i ~/.ssh/google_compute_engine roman@ 'python /some/path/example.py'
    

    The gcloud ssh key is located at ~/.ssh/google_compute_engine, which it uses. It also requires the external IP address of the instance instead of its name.

提交回复
热议问题