Re: openssh cygwin: connection closed by remote host



So I did try killing the new sshd processes by hand and it worked. I
can now log in as many times as I want without issue. Also I noticed
that when I start a new connection an sshd process is created with
parent pid = pid of the original sshd process, and also another process
with ppid=1. So two new sshd processes are created per new connection.
And upon logout the process with ppid=1 remains, but the other with
parent equal to the original sshd process goes away. Is this a hint?
If this problem can't be solved directly I'd be interested in hearing a
way in which to kill the child sshd processes upon logout in a clean
manner. The way in which I did it just now causes the remote terminal
to freeze since it is logged in and its sshd process is killed before
logging out. I have shell scripts logging in, doing stuff, and then
logging out, numerous times so i can't really have the term freeze each
time. Any thoughts on a solution or if not a solution for this work
around? Thanks again.

OK, well that's some progress.

The only reason I can think of that sshd processes might be left hanging
around is if they've spawned other processes that haven't terminated yet.
Are you starting some background tasks on each login that aren't completing
when you log out? See if you can use pstree on the server to find any
descendants of one of those leftover sshd processes.

If that doesn't solve your problem, then I think you have a bug in Cygwin's
OpenSSH server package, and you should report it as such to the Cygwin
mailing list. Be sure to attach the output of

cygcheck -svr

as a text file attachment (not inline) to your message. The Cygwin police
will jump all over you if you don't, and besides that it may be especially
important in this case. Cygwin recently released a new version of their DLL
(1.5.20) which is having a lot of unusual problems reported against it. If
you're using that version your problems may be related to that.

As for automatically killing the extra processes as a workaround, I don't
have any ideas offhand, but I'm sure it can be done.

Good luck,
Andrew.

--
To reply by email, change "deadspam.com" to "alumni.utexas.net"
.



Relevant Pages

  • Re: openssh cygwin: connection closed by remote host
    ... What do the server logs show from this exchange? ... Did you crank up LogLevel ... forked sshd process is not killed. ... unable to open a connection, got: will not fork when running in ...
    (comp.security.ssh)
  • Re: openssh cygwin: connection closed by remote host
    ... forked sshd process is not killed. ... unable to open a connection, got: will not fork when running in ... Any time someone logs into the server, it forks off a new process to handle ... that allows you to keep logging in. ...
    (comp.security.ssh)
  • Re: openssh cygwin: connection closed by remote host
    ... debug1: Connection established. ... So I have noticed that upon logout from a remote session that the ... forked sshd process is not killed. ...
    (comp.security.ssh)
  • Re: SSH connection problems
    ... NWR> check its contents. ... NWR> sshd process. ... the error message indicates the server terminated ... the connection immediately after opening it, ...
    (comp.security.ssh)
  • Re: openssh cygwin: connection closed by remote host
    ... So two new sshd processes are created per new connection. ... I have shell scripts logging in, doing stuff, and then ... and you should report it as such to the Cygwin ...
    (comp.security.ssh)