Description Usage Arguments Details Value See Also Examples
Add SSH details to a gce_instance
1 2 |
instance |
The gce_instance |
key.pub |
filepath to public SSH key |
key.private |
filepath to the private SSK key |
username |
SSH username to login with |
overwrite |
Overwrite existing SSH details if they exist |
You will only need to run this yourself if you save your SSH keys somewhere other
than $HOME/.ssh/google_compute_engine.pub
or use a different username than
your local username as found in Sys.info[["user"]]
, otherwise it will configure
itself automatically the first time you use gce_ssh in an R session.
If key.pub is NULL then will look for default Google credentials at
file.path(Sys.getenv("HOME"), ".ssh", "google_compute_engine.pub")
The instance with SSH details included in $ssh
Other ssh functions: gce_ssh_browser
,
gce_ssh_setup
, gce_ssh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Not run:
library(googleComputeEngineR)
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")
## 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
vm <- gce_ssh_setup(vm,
username = "mark",
key.pub = "C://.ssh/id_rsa.pub",
key.private = "C://.ssh/id_rsa")
## run command on instance
gce_ssh(vm, "echo foo")
#> foo
## example to check logs of rstudio docker container
gce_ssh(vm, "sudo journalctl -u rstudio")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.