- If not already installed, you must first install PuTTY. If you use the normal windows installer for PuTTY you will also get PuTTYgen but if you just downloaded PuTTY.exe then also get PuTTYgen.exe. On the SICE-managed Windows systems you should be able to install it from the Software Center, if not already installed.
- Open a command prompt windows window (cmd) on your Windows PC and run puttygen
- Click the 'Generate' button to generate a new keypair and move the mouse around, as directed, to generate randomness.
- Type in the passphrase you will use with the key in the 'Key passphrase' and 'Confirm passphrase' boxes.
- Click the 'Save private key' button and save the key in .ppk format. You can save it anywhere and give it any name you want but you will need to know where the key is in the following steps.
- Click the 'Save public key' button and also save that. I recommend giving it the same name as the private key put with the .pub extension.
- Go ahead and 'cut' the text from the OpenSSH key box of puttygen and leave that window open. We will need that in the following steps.
- Fire up PuTTY and enter the Host Name (eg. silo.sice.indiana.edu). Note that you can also use the username@hostname syntax (eg. firstname.lastname@example.org) to also specify your username so you aren't prompted for that each time.
- In PuTTY, then go to Connection > SSH > Auth and click the 'Browse' button under 'Private key file for authentication' and select the private key .ppk file saved in step 5 above.
- Go back to the main Session screen in PuTTY and enter a name for this login session under 'Saved Sessions' and click Save.
- Click Open to open a connection to the specified host. If this is the first time trying to log into this server you will have to accept the host key.
- Log in with your username and IU passphrase (not your ssh key passphrase). The first time you do this you may see a message 'Server refused our key' but ignore that.
- Once logged into a SICE Linux system, you will create a file named "authorized_keys" in your ~/.ssh folder. That is just a text file that contains the public keys (one per line) that you want to be able to use for logins. So, just paste the contents of the OpenSSH public key as shown in the puttygen window (the really long line in the box at the top that starts with something like ssh-rsa). When you are done, you should have a single very long line in your ~/.ssh/authorized_keys file on the linux system.
- Log out and then log in again. Use the same saved session you created above by just double clicking the session saved name.
- This time, it should prompt you for the passphrase for your saved SSH key so use the passphrase you used to create the key in puttygen. Since you are using an SSH key you will not have to use DUO as your 2nd factor in the authentication since you have 2-factor authentication this way with the SSH key plus the passphrase.