Search code examples
sshwindows-server-2012

sshd connections unexpectedly close on windows 2012


I have been using FreeSSHD to connect to my Windows servers[Windows 2K3 -R2 Enterprise servers and Windows 2K8-R2 Enterprise servers]. The Windows command prompt shows up after a successful SSH connection (i.e Windows platform).

[My Observations]: In case of Windows server 2012, the FreeSSHD installation goes through fine. I am able to make an SSH connection to the server from a remote machine. However, the SSH connection unexpectedly close and the putty terminal closes immediately. I enabled FreeSSHD logging and noticed that the connection is successfully made but terminated immediately.

The putty log shows the following error message:

tester@server-w12-1's password: Could not create child desktop: Access is denied.

I tried installing CopSSH. With this I am able to establish stable SSH connections. But it uses cygwin platform. I referred to "http://en.wikipedia.org/wiki/Comparison_of_SSH_servers" to get the list of available SSH servers.

[Rephrased Question]: In my application I am using SSH calls to connect to server (Windows & Linux) to query drive specific details. Can someone please suggest a free SSH server that runs on Windows 2012 server or suggest a fix for FreeSSHD session disconnect issue?

EDIT : I was unable to add an answer or add a long comment. So I am posting an edit.

[Solution]

Thanks Travis for your guidence. The issue is resolved. I did the following:

  1. Disable the setting "User Account Control: run all Administrators in admin approval mode" under local security policy
  2. Right Click FreeSSHd icon and click "Run as Administrator"
  3. Select the option "Run as Administrator" under "Compatibility" tab of FreeSSHd application properties
  4. As Travis had mentioned, ensure the SSH server is running. If not change the port# under FreeSSHd's SSH tab to say 222 and get it running. Restart the service
  5. My program needs the default port 22. So I changed the port back to 22 and I was able to have the service running
  6. I was able to SSH to the server even after multiple restarts

Solution

  • Please check following steps

    1.) FreeSSHd is running as a service.

    2.) SSH Service is running on the FreeSSHd console . It should be like this

    3.) If it not starting try changing the port of SSH under the SSH tab(for example 430 in my case).Like this

    hope this helps.