25.1 Basics of SSH
All of the PEcAn remote infrastructure depends on the system
ssh utility, so it’s important to make sure this works before attempting the advanced remote execution functionality in PEcAn.
To connect to a remote server interactively, the command is simply:
For instance, my connection to the BU shared computing cluster looks like:
It will prompt me for my BU password, and, if successful, will drop me into a login shell on the remote machine.
Alternatively to the login shell,
ssh can be used to execute arbitrary code, whose output will be returned exactly as it would if you ran the command locally.
For example, the following:
ssh email@example.com pwd
will run the
pwd command, and return the path to my home directory on the BU SCC.
The more advanced example below will run some simple R code on the BU SCC and return the output as if it was run locally.
ssh firstname.lastname@example.org Rscript -e "seq(1, 10)"