Connect from macOS and Linux

Generating and Uploading an SSH Key Pair

A key pair is required to connect to a cluster. A key pair consists of a private key and a public key. The private key remains on your desktop/laptop and should never be shared with anyone. Your public key is installed in ~/.ssh/authorized_keys on the cluster. In order for someone to access your account on the cluster, they must possess your private key and its associated passphrase.

To generate a new key pair, first open a terminal/xterm session. If you are on macOS, open Applications -> Utilities -> Terminal.

Generate your public and private ssh keys. Type the following into the terminal window:

ssh-keygen

Your terminal should respond:

Generating public/private rsa key pair.
Enter file in which to save the key (/home/#yourusername#/.ssh/id_rsa):

Press Enter to accept the default value. Your terminal should respond:

Enter passphrase (empty for no passphrase):

Choose a secure passphrase. Your passphrase will prevent access to your account in the event your private key is stolen. The response will be:

Enter same passphrase again:

Enter the passphrase again. The key pair is generated and written to a directory called .ssh in your home directory. The public key is stored in ~/.ssh/id_rsa.pub.

Next, install your public ssh key on the cluster. Run the following command in a terminal:

cat ~/.ssh/id_rsa.pub

Copy and paste the output to Yale HPC ssh key installer (only accessible on campus or through the Yale VPN). It may take up to 15 minutes after uploading for your key to be pushed to the clusters. Note that you should never send the private key file to anyone!

Logging into a Cluster

Once your public key has been installed, you may use ssh in a terminal to access the appropriate cluster. You need to know 2 things to log into a cluster.

  1. the hostname of the cluster login node
  2. your netid

You can find the hostnames of the cluster login nodes here. Open a terminal window and connect to the login node using the syntax:

ssh netid@login-node

For example, if your netid is ra359 and you wish to log into the Omega cluster:

ssh ra359@omega.hpc.yale.edu

How to Get a Graphical Interface (e.g. MATLAB)

The clusters are command line only. However, it is possible to allow specific applications (e.g. MATLAB) to send windows across the ssh connection. To get this functionality, include the "-Y" flag when logging on to the cluster.

$ ssh -Y netid@grace.hpc.yale.edu

On macOS, you will also need to install XQuartz. Make sure to install version 2.7.8, since newer version break compatibility with certain graphically intensive software.

For information about getting optimal interactive GUI performance on Omega and Ruddle , see our X11 Forwarding Guide for OSX (ignore the step regarding XQuartz if on Linux) for a detailed walkthrough. For all other clusters, follow the instructions on the correct scheduler instructions: Farnam and Grace.

Change Your SSH Key Passphrase

Enter the following in a Terminal window and follow the prompts:

ssh-keygen -p

If you forget your passphrase, it cannot be recovered. Instead, you will need to generate and upload a new ssh key pair.