OpenSSH for Windows

Notes from OpenSSH for Windows site -

"OpenSSH for Windows is a free package that installs a minimal OpenSSH server and client utilities in the Cygwin package without needing the full Cygwin installation.

The OpenSSH for Windows package provides full SSH/SCP/SFTP support. SSH terminal support provides a familiar Windows Command prompt, while retaining Unix/Cygwin-style paths for SCP and SFTP."

To setup OpenSSH on a Windows PC follow the instructions below -

  1. Extract setupssh.exe from the OpenSSH download and install using default settings - this will install the required files to the C:\Program Files\OpenSSH\ directory.
  2. Start a command prompt and enter the following -
    CD "C:\Program Files\OpenSSH\bin" [enter]
  3. Create a group file -
  4. Create a passwd file (it is not possible to login to the server until a passwd file has been created) -
  5. In order to allow login via an encrypted key file the OpenSSH configuration file will need to be edited. To create a backup, open C:\Program Files\OpenSSH\etc\sshd_config in notepad and save as C:\Program Files\OpenSSH\etc\sshd_config.bak.
  6. Now replace the text in the configuration file (C:\Program Files\OpenSSH\etc\sshd_config) with the following (use copy and paste - highlight all text in the textbox below and hold the [ctrl]+[c] keys to copy, then [ctrl]+[v] to paste into notepad). See here for changes to the original C:\Program Files\OpenSSH\etc\sshd_config (edited lines are in red) -

  7. See here for instructions on creating public and private key files using PuTTYgen.exe.
  8. Assuming the instructions were followed in step 7 and PuTTYgen was used to create the keyfiles, copy authorized_keys to the C:\Program Files\OpenSSH\etc\ directory.
  9. To start the OpenSSH service, open a command prompt and enter the following -
    net start opensshd [enter]