UND HPC Tutorial - Using SSH Keys to Login
UND Computational Research Center
Here is some basic information on how to connect to the UND HPC Linux clusters and login using ssh keys. In this example we will be using Talon.
Your Talon Account
If you do not already have an account on one of the clusters, you will need to get request an account. To do this you will need to submit a request using the request form Here.
This tutorial assumes you are able to login to the cluster using your password.
Software
If you are on Windows you will need to install a program to generate and use the keys. We recommend using the putty packages (puttygen and pagent). These should be included with a regular install of putty, otherwise they are located at https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html.
Linux and mac users do not need to install any additional programs.
Generating keys
Windows
Once you have puttygen installed open it up and you should be greeted with the following screen.
Click Generate.
It will have you move your mouse around randomly. Do this until the green bar is completely filled.
Once it has generated your new key change the key comment to something like
first.last
, add a passphrase in the passphrase boxes and click the save buttons ("Save public key" and "Save private key") saving to a location on your hard drive that you will remember.These files are your Public and Private keys.
- The private key will have a
.ppk
extension NOTE: Never share your Private key with anyone
- The private key will have a
Linux and Mac
Open your terminal.
Run the following command
ssh-keygen -t rsa -C "first.last"
Press
Enter
to save the keys to the default locationEnter a new password two times
After the confirmation screen you should now have two files
- Private key: id_rsa
- NOTE: Never share this with anyone
- Public key: id_rsa.pub
- Private key: id_rsa
Importing the key
Open your public key. It should have the format as follows:
ssh-rsa <Long key string>==first.last
On Linux and mac this should be how it is formatted
On Windows
- If you copy from the puttygen window it will be in this format.
- If you are copying from the public key you will need to do some formatting to put it all on one line
Copy the key string
Login to the cluster you are trying to use and open
~/.ssh/authorized_keys
Paste in your key and save the file.
Logging in
On Linux and mac you should be all setup. To login just use your normal ssh commands and enter the password for your ssh key when prompted
On Windows you will need to load the key with pagent.
Start Pagent. It will show up in your icons on the task bar.
Right click the icon and select add
view keys
Click
Add key
and open the key that you saved earlier.- It will ask for the password and then show up in the list of keys.
- You should now be able to use your normal putty session to login to the cluster.