Generate an SSH key

SSH keys provide a secure way for you to authenticate (log in) to a remote system. SSH keys come in two parts, a public portion of the key that you can share with anyone and the private portion that stays on your personal computer and should be kept secret. After you generate your SSH key pair, you should send the public portion of the key (id_rsa.pub) to Roberta Mazzoli to have it installed in your account.The process for creating an SSH key pair is different depending on your platform. 

Linux (or if you’re using Cygwin on Windows):

    • Open a terminal window or console and type the following command:
      ssh-keygen

You can accept the default answer for most of the questions but please enter a passphrase to protect your key.
When the key generation finishes, your public key will be in ~/.ssh/id_rsa.pub.

 

Mac:

    • Open a terminal window or console and type the following command:
      ssh-keygen -t rsa

You should accept the default answer for most of the questions, but please enter a passphrase to protect your key.
When the key generation finishes, your public key will be in ~/.ssh/id_rsa.pub.

 

Windows:

  1. Download Putty, Puttygen and Psftp from the following links:
  2. Open Puttygen by double clicking the program icon.  This will open a screen that lets you generate a new key.  Click on the button that says “Generate” to create a new key.  After you generate the key, there will be a text box at the top of the screen that says “Public key for pasting into OpenSSH authorized_keys file:”  Copy that text and email it to Roberta Mazzoli.  Click “Save Private Key” to store the private key file on your computer.
  3. Start Putty, and in the box that says “Hostname (or IP address)” enter “kenny.whoi.edu”.  Below that, there’s a box that says “Saved Sessions” where you can enter just “kenny” in the box.
  4. On the left side of the window, there will be a list of options.  Click on the “+” sign next to “SSH” to expand it, and then click on “Auth” in the expanded list. In the middle of the screen, there’s a box that says “Private key file for authentication:” with a button that says “Browse…” next to it.  Click the “Browse…” button, and find the key file that you saved from puttygen.exe.
  5. Scroll to the top of the list on the left side, click “Session” and then click “Save” in the middle of the screen. Now, whenever you start Putty, you should have an entry in the “Saved Sessions” list for kenny.
  6. Double click, and it should log you in.

Please contact Roberta Mazzoli at ext. 3603 or rmazzoli@whoi.edu if you have questions.