Document Goal

Describe how to connect to the Erisone HPC environment with a variety of tips and tricks via ssh. Specifically, this will illustrate how to access the servers without a VPN and access RStudio sessions on rgs13 and rgs14 using a URL-aware proxy. Throughout the document, I’ll use cl322 as the username that’s affiliated with Partner’s (this is Caleb’s username).

Quick start into the different servers

TLDR: Use rgs13 and rgs14 whenever possible to actually do work.

Easy, obvious way to connect

ssh cl322@rgs13.research.partners.org


Accessing RStudio with a VPN

Once connected to the VPN, simply enter the following to connect to the workstation’s Rstudio server instance–

https://rgs13.research.partners.org/rstudio/
https://rgs14.research.partners.org/rstudio/

rgs14 is running the Pro version, which faciliates multiple versions of R. This is the ideal instance to use likely.


Setting up SSH Tunneling

Perhaps we may be interested in accessing the work station without using the VPN. This may be particularly useful if we want to transfer files between servers. To get the keys needed to setup tunneling, fill out this form:

https://rc.partners.org/ssh-bastion-request

Shortly hafter submitting your ssh request, you’ll get login key files and a super secret password. IT support has this file that has a good description of how to configure this on your machine.

https://rc.partners.org/kb/article/2891

Assuming that you have this all setup, when you ssh to the public facing server, you’ll get prompted to give your passphrase that was emailed to your separately. This is annoying to keep typing. You can permenantly add your passcode using the following command:

ssh-add -K ~/.ssh/id_ecdsa

Note: be sensitive to the actual name of the file (i.e. if you changed it when transferring files form the Erisone emails).


Actually SSH Tunneling

Okay so To do this, we’re going to create an ssh tunnel to the workstation through a publically facing Erisone server (i.e. ssh.partners.org). Here are the basic steps–

Accessing RStudio w/o VPN

Using the ssh tunnel, we can route our web traffic through the Partners server using a Socks Proxy by binding a port (e.g. 8080) using ssh (e.g. -D 8080; see the other sections below for synchrony with this and the other tunnel happenings).

One of the more useful features that I’ve discovered is using FoxyProxy, which enables a URL-aware execution of the Socks Proxy. In other words, you can configure it to only route traffic through the Partners server if the URL matches some regular expression. I’ve configured my settings like so:

-

With the proxy settings set up like this, we can access the RStudio URLs automatically as long as our Socks Proxy is established.

https://rgs13.research.partners.org/rstudio/
https://rgs14.research.partners.org/rstudio/

Aliases

-All of these commands can be added to your .bashrc or .bash_profile file under simple commands that will make your life much, much easier. Ask Caleb if you want to do this/don’t know how to do this. For example, we can change the first command that builds the tunnel using the following command:

echo  m="ssh -L 2213:rgs13.research.partners.org:22 -L 2214:rgs14.research.partners.org:22 -L 8789:rgs14.research.partners.org:80 cl322@ssh.partners.org" >> ~/.bashrc

which will allow you to replace the command to tunnel to the server by simply typing m rather than the long ssh command.


Moving Files via ssh tunneling

Perhaps we want to scp files, such as all the single-cell ATAC bam files. This can be done using the form of the following command:

scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P 2213 `find ./ -name "singles*bam"` cl322@localhost:/data/aryee/OTHERPATHINFORMATIOn

An important thing to not here is that the scp synatx requires a captial “P” whereas ssh uses a lowercase “p” to specify the port.


Putting it all together

or at least this is how Caleb’s set it up on his machine. In my ~/.bashrc file, I have added all of the following aliases and commands:

alias m="ssh -L 2213:rgs13.research.partners.org:22 -L 2214:rgs14.research.partners.org:22 -D 8080 cl322@ssh.partners.org"

alias rgs13tunnel="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2213 cl322@localhost"
alias rgs14tunnel="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2214 cl322@localhost"

alias scprgs13="scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P 2213"

Then, I can 1) build the tunnel using just the m command in a terminal window, 2) easily access the login servers rgs13 and rgs14 using the tunneling, 3) have established aliases for copying files, and 4) access RStudio server instances using a Socks Proxy. Using FoxyProxy, the only traffic that routes through the Partners network are websites that match a URL pattern that includes rgs13 or rgs14.