SWEN-250

Setting up SSH keys on your personal computer

Using SSH With Keys on your personal device

You are not allowed to connect to SE machines (e.g. hamilton) using only your SE password unless you are on the RIT network or are using a secure key. If you are off campus you can connect to the RIT network via RIT's VPN.

The rest of of this document describes how to configure your machine to use your ed25519 key to connect to hamilton while off campus. If you are using the VPN you will not need to do this.

Adding Your Public Key to authorized_keys

First we need to add your public key to your authorized keys list. To do this connect to hamilton using ssh (ssh username@hamilton.se.rit.edu). Change to your .ssh directory (cd .ssh). Execute the command cat id_ed25519.pub >> authorized_keys to add your public key to your list of authorized keys.

Getting Your Private Key Onto Your Personal Machine

When setting up your GitLab account you created a ed25519 key set (private/public keys). You placed them in your hamilton .ssh folder. You will need to get your private key onto your personal machine if you wish to connect using a key when off campus. To do this, open a command prompt and navigate to where you want to store the key. I would recommend C:\Users\username\.ssh, where username is you local username (this should be where your command prompt starts). You will most likely need to create the .ssh directory (mkdir .ssh). Make sure you are in your local .ssh directory and connect to hamilton using sftp username@hamilton.se.rit.edu. Navigate to your ssh directory on hamilton cd .ssh. Perform a get on the id_ed25519 file (your private key), get id_ed25519. Lastly exit sftp by entering bye.

Create a Config File

Download the config file (right click and choose "save link as") to the same place you saved your private key. Note: Windows will most likely try to add a .txt ending. I recommend removing that ending either before, or after saving the file. Make sure to replace any <...> segments with the correct values, i.e. your username.

SSH Using a Config File

Now you are ready to connect to hamilton using the config file. If you saved everything in C:/Users/username/.ssh, and named your config file config, you should be able to enter ssh se from the command prompt and it will initiate the connection. At which point you will need to enter the password for your key (not your SE password). This is the same password you have been using with git.

If you saved your files somewhere else you can still use them but you will need to specify the location of the config file. In the command prompt navigate to where you saved the config file and your key. Enter the command ssh -Fconfig se. This assumes you saved the config file with the name config.

If you saved your config file under a different name (i.e. config.txt) you will need to use that name after the -F option. Using a differnt name will also prevent ssh from automatically finding the config file even if you have placed in in your .ssh directory.