Setting Up Key Based Authentication

Key pairs use cryptography to authenticate you rather than your usual password by checking that you have access to the private key that corresponds to the public key that is on the remote machine you are trying to connect to, in this case the Mill. You will need either a copy of this private key, or a new key-pair for each device you wish to connect to this way. For more information on key based authentication look here: (https://www.ssh.com/academy/ssh/public-key-authentication) 

Using PuTTY 

If you are using PuTTY you will need to use PuTTYgen following the instructions here (https://www.ssh.com/academy/ssh/putty/windows/puttygen) to generate the keypair. When you get to the section for installing the public key on the remote system, be careful not to delete the key that is already in your authorized_keys file on the Mill. This key is important for your ability to use the cluster. If you are not comfortable doing this yourself, you can also send us the contents of your public key in a ticket (help.mst.edu) and we will add it to your account for you. 

Using MobaXterm 

If you are using MobaXterm, start a new local terminal session (not connected to the Mill) then follow the instructions directly below this for using the Mac or Linux terminal. 

Using Mac or Linux Terminal 

If you are using a Mac or Linux terminal, use the command “ssh-keygen” to generate a new key pair. We recommend using the default location and taking note of the path to this location in the output that says where the keys are stored in case you need to find them later. You will then be prompted for a passphrase. You can either set one or press enter to skip. You will be prompted for this passphrase each time you attempt to authenticate using this key pair. 

NOTE: PASSPHRASES ARE NOT RECOVERABLE BY US 

To get your public key onto the Mill, you can first try the following command, which should work if your system is using an OpenSSH based client, and you saved your key in the default location (both will be true in most cases): 

ssh-copy-id USERNAME@mill.mst.edu 

If you already have other keys in use or did not use the default location, you will want to specify the correct public key by using the path you made a note of before: 

ssh-copy-id -i /path/that/you/copied/KEYNAME.pub USERNAME@mill.mst.edu 

If this command is not found, or you run into other problems, you can also send us the public key in a ticket (help.mst.edu), and we can manually add it to your account. 

NOTE: If you try to add the key manually yourself DO NOT delete the key that is already in the authorized_keys file, or the file itself. This will break key functionality for your user account on the cluster and is very annoying to fix. 

Now you can test your key. If you are using PuTTY or MobaXterm you will need to follow the documentation to add your key to your session first, then all you need to do is connect as normal. If you set a passphrase on your key, you will be prompted for that instead of your password, otherwise you should be dropped directly into the Mill without needing a password. If you have followed the previous steps and this is not what is happening, please send us a ticket to let us know.