cygwin sshd.exe & service randomly hang after a few days

0

I have cygwin and sshd installed, latest versions as of last month, on a Win7 Pro 64-bit box. I can ssh in from a Linux box no trouble. (It's identical to a setup I have on a Windows 2003 Server box that hasn't had this problem yet.)

Then, randomly, after some length of time, apparently usually days, when I try to ssh in, ssh just prints a blank line and the cursor blinks there until I Ctrl+C.

I remote into the Win7 box, and sshd.exe is running with normal CPU usage (0) in Task Manager. I go to Services, and it says sshd is running. I tell it to restart, and it fails to stop: the progress bar comes up, goes to about 40%, then crawls along, and eventually says it couldn't be stopped (but now it is stopped--I have the option to start.) If I try to start, it tells me that it started and stopped immediately:

Services

The CYGWIN sshd service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs. OK

This whole time sshd.exe is still in Task Manager. At this point, I kill sshd.exe in Task Manager, and then I can go back to Services and can start sshd no problem, after which I can ssh in from Linux no problem.

I've seen various threads about similar-sounding situations from as far back as 2006, but no solutions besides increasing MaxSessions in /etc/sshd_config. Only one user ssh's in, so I don't think MaxSessions needs increasing.

What causes this?

Kev

Posted 2013-12-12T14:04:14.993

Reputation: 1 069

Answers

0

I could not find the cause. This is a crappy answer, but an unobtrusive (for my requirements) workaround is to schedule once a day to:

Taskkill /IM sshd.exe /F
net start "CYGWIN sshd"

Kev

Posted 2013-12-12T14:04:14.993

Reputation: 1 069

Turns out it actually happens within 13 hours. I'm going to schedule it to happen 30 minutes before I need it every day, but it would be much better if there were an actual fix, because if I happened to be doing something ad-hoc that ran into this schedule, it would fail. – Kev – 2014-01-09T14:12:50.797