# NOT RUN {
# }
# NOT RUN {
vm <- gce_vm("my-instance")
## if you have already logged in via gcloud, the default keys will be used
## no need to run gce_ssh_addkeys
## run command on instance
gce_ssh(vm, "echo foo")
#> foo
## if running on Windows, use the RStudio default SSH client
## e.g. add C:\Program Files\RStudio\bin\msys-ssh-1000-18 to your PATH
## then run:
vm2 <- gce_vm("my-instance2")
## add SSH info to the VM object
## custom info
vm2 <- gce_ssh_setup(vm2,
username = "mark",
key.pub = "C://.ssh/id_rsa.pub",
key.private = "C://.ssh/id_rsa")
## run command on instance
gce_ssh(vm2, "echo foo")
#> foo
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab