Tuesday 26 April 2016

Setting up an SSH server on Windows

The problem 

Consider the following scenario :
  • There is a desktop application that it is running across different operating systems : Windows, Linux, OSX (Mac). 
  • We designed a test case which its steps are able to be executed by commands on the terminal (on linux and OSX) or at the command-line (on Windows). We need to automate the execution of that test case in all operating systems by triggering and executing the operating-system specific commands from a central linux server (let's name it the 'test server')
  • In our test lab environment, there is a test server (VM running Ubuntu) and three test devices that run the 3 different operating systems (e.g. Windows 7, Ubuntu 14, OSX 10.11)

The solution

Installing an SSH server  is a nice way to enable the cross platform communication from the test-server. Until the official release of the SSH integration with the PowerSell on Windows, we decided to go with the FreeSSHd desktop software to set up the SSH server on windows.

Installation steps :
  1. Download the latest freeSSHd version 
  2. Install the application without installing its service
  3. Start freeSSHd as administrator
  4. Open the freeSSHd settings window and add a new user with login and password 'demo', authorization type 'Password stored as SHA1 hash' and with checked Shell and SFTP  (Figure 1).
  5. Go to the 'Authentication' tab and select Password authentication to 'Required' and Public key authentication to 'Disabled'
  6. Restart the application as administrator and make sure that the SSH server is running (Figure 2)
  7. And you are done !

Figure 1 : Create a user account

Figure 2 : SSH server status