Quote:
im having the same problem. after further investigation, ive discovered several port 22 connections in the close_wait state, even though the freesshd service isn't running. i wonder if this could be part of the problem.
If we go back to the older posts, we know exactly this is what is causing the problem, yes certain processes are occupying the ports
as a result, the freesshd will give this error.
If you really want to free up the SSH port, you could bring up task manager to see the programs if you previously executed remotedly. Kill them all will fix this problem.
Now this is a chicken-and-egg problem, why certain processes (created by freesshd ) are occupying the ports ? I have personally seen before such thing happening. This my reasoning :-
It happens if your previous remote tasks are in executed but hit some error during the execution, and some are even blocked. And because freesshd execute the process without waiting for it to complete, and as the ssh client closes the connection, it still leaves the remote tasks running. Therefore a blocked/staled process will continued to be blocked.
In unix environment, when a login user sign on the execute a background job, and if he logs off before the job is completed, the shell will immediately send a signal to the the job, and the job upon receiving the signal will terminate and clean up. However, this is not the case for most Windows programs. They don't handle 'signal'.
Short of having a posix environment, I am not sure what is the best way to solve this problem. In the meantime, you just have to make sure all your remote jobs are executed successfully and nothing is blocked or staled.