Login securely from Windows to Linux using FastX Client or X-Win32

Secure and convenient method to authenticate using an SSH public key along with pageant.exe.

  1. Download and install Putty (https://www.putty.org/).
  2. Run the “PuTTYgen” program.
  3. Click “Generate”. Follow instructions.
  4. Give the key a better name, and enter a passphrase. (You will enter this passphrase every time you log into your Windows computer.)
  5. Click “Save private key”. Save it somewhere you can find it later, recommend using your Documents folder.
  6. Click in the box near the top, under the text that says: “Public key for pasting into OpenSSH authorized_keys file.”
  7. Right-click, Select All, right-click, Copy. (Keep this in your clipboard for step 12)
  8. Launch PuTTY.
  9. Enter the hostname of your Linux server, and click “open”.
  10. Log into your Linux server.
  11. At the Linux prompt, type: mkdir .ssh then tee -a .ssh/authorized_keys
  12. Click the right mouse button. This should paste the text you copied to your clipboard earlier.
  13. Press Enter, then Control-D.
  14. Check the permissions on your .ssh directory and the authorized_keys file. They should not be writable by anyone but you. If they are, type chmod og-w .ssh .ssh/authorized_keys. (Or just type it anyway, so you don’t need to check.)
  15. Log out of the Linux system.
  16. Close PuTTYgen (PuTTY Key Generator).
  17. In Windows, open “Documents”, or the directory you saved your private key in step 5.
  18. Hold the Windows key down, and type “R” (Windows-R).
  19. In the box that appears, type shell:startup. This will bring up a second folder named “Startup”. Leave both “Documents” and “Startup” open. We will use them both.
  20. In the “Documents” folder, right-click on the file you saved in step 5, and select “Create shortcut”.
  21. Drag this shortcut into the “Startup” folder. You may then rename it, if you like.

Testing Login

  1. Log out (or shutdown) Windows. Then log back in.
  2. After you log in, a window should appear that says “Enter passphrase to load key …”. Enter the passphrase you created in step 4 above. You will not have to enter this passphrase again until you log back in to your Windows system.
  3. Launch the FastX client or X-Win32. If you have created a connection and saved a password in it, edit the connection and remove the password.
  4. From FastX or X-Win32, launch the SSH connection to your Linux system. It should connect without asking for a password.