Skip to content

Setup SSH Keys for NCShare Cluster Computing

Users who would like to directly interact with the NCShare Cluster Computing environment through the Slurm Workload Manager may do so by enabling SSH key authentication from their workstation.

Users who are not comfortable using the command line can access cluster resources through Open OnDemand, which provides a access to interactive sessions hrough your browser. The Open OnDemand service. provides acesss to the DCC through RStudio, Jupyter, or Linux desktop sessions.

Warning

If you have not already signed up for NCShare resources, first sign-up for an account.

SSH Keys

Setting up ssh keys from your workstation will enables login via ssh and will simplify file transfer process by creating a secure key-based session between your workstation and the NCShare Cluster.

Step 0: Testing SSH on Your Computer

There are subtle differences in running SSH between Windows, macOS, and Linux. See specific instructions for your computer below. Following the instructions below should generate a "Usage Message" similar to this:

usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
           [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
           [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-J [user@]host[:port]] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] destination [command]

If you get this Usage Message you are ready to go to on to Step 1


Windows

Recently versions of Windows usually include SSH by default (but not always). The best way to use SSH on Windows computer is through Windows PowerShell

  1. Press Start → type “PowerShell” → press Enter.
  2. In the window, type ssh and press Enter.

macOS

macOS already includes SSH in the Terminal app.

  1. Open the Terminal: Press Command + Space, type Terminal, and press Enter.
  2. In the Terminal window, type ssh and press Enter.

Linux

Almost all Linux distributions come with SSH built‑in.

  1. Open your terminal (for example, Ctrl+Alt+T).
  2. In the terminal window, type ssh and press Enter.

Step 1: Generate an SSH key pair

Now that you have confirmed that SSH runs on your local computer, you are ready to generate the SSH key pair that you will use to authenticate with NCShare (instead of a password)

  1. Run the following command the same way you ran SSH in Step 0 (i.e. in the terminal or PowerShell)

    ssh-keygen -t ed25519
    

    This will print:

    Generating public/private ed25519 key pair.
    Enter file in which to save the key (/hpc/home/YOUR_USERNAME/.ssh/id_ed25519):
    

  2. You should press Enter to use the default.

    Now it will print:

    Enter passphrase (empty for no passphrase):
    

  3. Choose an "SSH key passphrase" and type it in. ssh-keygen will NOT show what you are typing (just in case someone is looking over your shoulder). Press Enter once you have typed in your passphrase.

  4. ssh-keygen will now print:

    Enter same passphrase again:
    
    Enter the same passphrase. Again, ssh-keygen will NOT show what you are typing.

  5. ssh-keygen will now print something like this (but there will be some differences):

    Your identification has been saved in /hpc/home/YOUR_USERNAME/.ssh/id_ed25519
    Your public key has been saved in /hpc/home/YOUR_USERNAME/.ssh/id_ed25519.pub
    The key fingerprint is:
    SHA256:h2xH79645IYsdCFxOLLMwxWYtl5DWqX5fv0nFfCzqQc YOUR_USERNAME@COMPUTER
    The key's randomart image is:
    +--[ED25519 256]--+
    |       o.+.      |
    |      = Bo.  .   |
    |     = Oo+.   o  |
    |      O.++..   + |
    |     . oSo+..   =|
    |      ...+.. E o.|
    |       . o..+ +. |
    |        . o=.+.o.|
    |         . .=.o.o|
    +----[SHA256]-----+
    

Step 2: Add Your Public Key to Your NCShare Profile

  1. Click here to go to NCShare COmanage

  2. Click on the LOGIN button

  3. Click on your university in the Choose Your Institution Box. You may be asked to sign in through your university's authentication system (if you aren't already signed in).

  4. On the NCShare COmanage page, click on your name in the top-right corner, then click on MY PROFILE (NCSHARE)

  5. Click on Authenticators in the upper-right corner of your profile page

  6. Click on the Manage button under Actions (this should be to the right of "SSH Keys for Unix")

  7. Click on the Add SSH Key link in the upper-right corner of the "SSH Keys for Unix" page

  8. Click on the Choose File button to find your public key file

    A. Navigate to your home folder (usually named with your username) in the file selection dialog that opens - macOS: Hold the Command and Shift keys while you press the period (".") key, to show hidden files - Linux: This webpage gives instructions for showing hidden files in several different desktop environments

    B. Open the ".ssh" folder

    C. Select the "id_ed25519.pub" file it is important that you do NOT select the "id_ed25519" file (the file without the ".pub")

  9. Click the UPLOAD button. the "SSH Keys for Unix" page should now show your key listed as "YOUR_USERNAME@COMPUTER" (this should be the same as what ssh-keygen printed about for "The key fingerprint is:")

  10. On the NCShare COmanage page, click on your name in the top-right corner, then click on MY PROFILE (NCSHARE)

  11. Make a note of your NCShare UID under the Identifiers section, which you will need this in the next step. This will probably be different than your username at your university.

Step 3: Connect to NCShare with SSH

  1. In your terminal (macOS or Linux) or PowerShell (Windows) type: ssh NCSHARE_UID@login.ncshare.org, substituting your NCShare UID for "NCSHARE_UID"

  2. In response to the following question, type yes and press Enter

    The authenticity of host 'login.ncshare.org (198.86.179.8)' can't be established.
    ED25519 key fingerprint is SHA256:OC5NhEm80c0UVlTOYw0KFGqCwwDNGW1FqSjUasjHDE4.
    This key is not known by any other names
    Are you sure you want to continue connecting (yes/no/[fingerprint])?
    

  3. In response to the following question, type your "SSH key passphrase" and press Enter (SSH will NOT show what you are typing). This is the passphrase that you set when you generated your SSH key.

    Enter passphrase for key 'YOUR_HOME_DIRECTORY/.ssh/id_ed25519':
    
  4. Confirm that you have successfully connected by typing hostname -A and pressing Enter. This should print:

    login-01.ncshare.org login-01 login-01
    
    Congratulations If you see this, you have successfully connected to NCShare using SSH!

  5. Once your are done you can type exit and press Enter. This will close the connection.