Login to server with RSA keys and PuTTY

Connecting to your VPS with PuTTY on Windows is quite easy. But it can be even easier and faster with RSA keys. In this tutorial we will discuss how to connect to your VPS with RSA keys and PuTTY on Windows.

Requirements

  • Have a (Ubuntu 14.04) VPS
  • Have PuTTY installed
  • Have PuTTYgen installed

Generate RSA keys

  1. Openup the program PuTTYgen
  2. Click on ‘generate’
  3. Move your mouse over the area.
  4. Save your publickey in a folder you won’t lose
  5. Save your private key in a folder you won’t lose (ex. Dropbox)

Upload RSA key to VPS

  1. Login to your VPS using PuTTY and the username password you already had
    1. Enter the IP in putty
    2. Change the port if needed
    3. Press ‘open’
  2. Copy paste the value from your previously saved public key to this file on your VPS
  3. Save the file (ctrl+o in nano)

Save RSA key in PuTTY

  1. Open PuTTY
  2. Enter your IP and port
  3. Type a name for your VPS under ‘Saved sessions’ and press ‘Save’
  4. Now go to connection->SSH->Auth and browse for your private key file at the bottom of this screen.
  5. Go to connection->data and enter an auto-login username to login with (ex. root or your name)
  6. Go back to Session in the tree on the left
  7. Save your session again

Disable password login

  1. Find PermitRootLogin and change that line to PermitRootLogin without-password
  2. Save the file using ctrl+o on nano