Connecting to the Cluster

From CS Support
Jump to: navigation, search

Setting up SSH Keys

SSH Keys allow for automatic login from one computer to another via ssh. This allows for a more secure connection since the keys can be much longer than any password a human could remember. The following instructions will show you how to setup an SSH keys using ssh-keygen and ssh which should be available on any *nix system you use.

Generate an ssh public key and private key pair in Unix/BSD/Linux/OSX/Cygwin/MinGW

In order to generate a public private key pair the following command needs to be run from the commandline, a terminal, or the console.

ssh-keygen

This will ask you for a password and then generate two files in the .ssh directory in your home folder: id_rsa and id_rsa.pub. id_rsa is your private key and should not be given to anyone, if someone does get this file they will be able to login to any computers that you use the key to login to. id_rsa.pub is the public key that will be added to the server's .ssh/authorized_keys file to allow you to login. *NOTE: USING A KEY PAIR WITHOUT A PASSWORD IS INSECURE AND SHOULD NOT BE DONE

Generate an ssh public key and private key pair in Windows for PuTTY

  1. Install PuTTY using the PuTTY installer
  2. Run PuTTYGen
    File:Puttygen generate.png
  3. Click Generate and wiggle your mouse
    File:Puttygen wiggle.png
  4. Enter and Confirm a Key Passphrase
    File:Puttygen passphrase.png
  5. Save your public and private key
    File:Puttygen save.png

*NOTE: USING A KEY PAIR WITHOUT A PASSWORD IS INSECURE AND SHOULD NOT BE DONE

Request account, and transfer the public key

Send an Email to cs.support@wwu.edu, from you university Email, it should contain the following

Subject: CSCI Compute Cluster Request

General University Username
What project you are working on and who your collaborators are
Any specific software requests you have
An attachment of your public key as username.pub (username should not be the literal "username"
but instead should be your general university username)

Get Confirmation

Once the account is setup and the we have populated your ~/.ssh/authorized_keys file with your public key we will Email you back letting you know this is done.

Check that everything is working from

Unix/BSD/Linux/OSX/Cygwin/MinGW

In order to verify that everything is working you should try to login to the machine using:

ssh -p 922 <username>@cluster.cs.wwu.edu

or

ssh -p 922 -i <path_to_privatekey> <username>@cluster.cs.wwu.edu

If you entered a passphase for you key then you will see the following:

Enter passphrase for key '/home/username/.ssh/id_rsa': 

Enter the password for your key pair and you should be logged into the server. If you did not enter a passphase for the key pair then you will be logged in automatically. If you are not logged in at this point you probably had a typo in one of the above commands.

PuTTY in Windows

Use a keychain

In order to keep from having to type in your key passphrase see the following article: Using_SSH_Agent

Using this Key elsewhere

Setup a machine to accept your public/private key pair

In order for a machine that you are logging into to verify your login credentials you must append the public key from the previous step (id_rsa.pub) to the ~/.ssh/authorized_keys file. One way to do so is using the following command if you have the capability with a password to access the machine you would like to use your key to access in the future.

cat .ssh/id_rsa.pub | ssh <username>@<server> 'cat >> .ssh/authorized_keys; chmod 600 .ssh/authorized_keys'