Setting up a SSH connection to a windows server

dbKoda 0.9 includes SSH terminal support, which allows you to open an SSH connection to the remote host running your MongoDB server.  This can be super useful to perform administration and host management tasks. 

On Linux and Mac, SSH is tightly integrated with the operating system and you usually don't have to do anything special to set it up.

However, on Windows SSH is not setup by default.  There are a few options for enabling Windows SSH server support on windows, and the latest version of Windows 10 includes a beta version of OpenSSH server.  

Currently, we're finding the best option for using SSH on windows to be the Cygwin project implementation.  Cygwin offers Windows binary implementations of linux utilities and commands, including SSH. 

This blog post summaries the procedure for installing Cygwin SSH.  Providing you have Cygwin installed it's mostly a matter of issuing the `ssh-host-config` command from a Cygwin terminal.  

Once you start the Cygwin sshd service - and possibly configure your windows firewall to allow connections through port 22 - you are ready to connect from dbKoda. 

In your dbKoda connection configuration, specify the Windows host or IP address in the SSH section, together with the username and password you wish to use:

Once you've done that you can establish an SSH connection to the host by right clicking on the connection and choosing `New SSH Terminal`.   By default this will open an Cygwin Bash shell, but you can type `cmd` or `powershell` to get a DOS prompt or Powershell command line:

You don't need to connect to the mongodb server to get a shell running, so you can use the terminal window to start the mongodb service if it is not already running or do other windows maintenance tasks.  

Is this article helpful?