Child pages
  • Using SSH Key Authentication On The Unified Linux Systems

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. 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.
  2. Open a command prompt windows window (cmd) on your Windows PC and run puttygen
  3. Click the 'Generate' button to generate a new keypair and move the mouse around, as directed, to generate randomness.
  4. Type in the passphrase you will use with the key in the 'Key passphrase' and 'Confirm passphrase' boxes.
  5. 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.
  6. 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.
  7. 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.
  8. Fire up PuTTY and enter the Host Name (eg. silo.sice.indiana.edu).  Note that you can also use the username@hostname syntax (eg. janedoe@silo.sice.indiana.edu) to also specify your username so you aren't prompted for that each time.
  9. 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.
  10. Go back to the main Session screen in PuTTY and enter a name for this login session under 'Saved Sessions' and click Save.
  11. 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.
  12. 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.
  13. 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.
  14. Log out and then log in again.  Use the same saved session you created above by just double clicking the session saved name.
  15. 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.

...