ssh over stunnel hangs on second connection

cygwin@kosowsky.org cygwin@kosowsky.org
Sun Feb 18 04:53:32 GMT 2024


Andrew Schulman via Cygwin wrote at about 14:55:58 -0500 on Saturday, February 17, 2024:
 > >  > 
 > >  > But supposing you keep your current configuration. Can you please clarify how
 > >  > you're invoking stunnel? Do you have a ProxyCommand directive in your
 > >  > .ssh/config, like:
 > >  > 
 > >  > ProxyCommand /usr/bin/stunnel stunnel.conf
 > > 
 > > No... I just ssh to 'localhost' on the port that per stunnel.conf is
 > > listening for client connections.
 > > This works fine in Ubuntu and has worked fine for me before on
 > > Win7/Win10.
 > > 
 > > I don't use any fixed ProxyCommand to invoke stunnel because the vast
 > > majority of the time I just use straight SSH -- I only use 'stunnel'
 > > when SSH is blocked.
 > 
 > OK. So why that worked before and it doesn't work now, I don't know. But what
 > that sounds like to me is that you have only one stunnel process. When you
 > reproduce the problem, how many stunnel processes are running?
 > 
 > ps | grep stunnel
 > 
I have only one 'stunnel' process.
But remember that:
1. On Cygwin, so long as I don't 'exit' ssh, I can have multiple 'ssh'
   processes connect successfully over a single 'stunnel' process

2. Similarly, on Ubuntu, I can have multiple 'ssh' logins (and
   logouts) over a single 'stunnel' process

So again it seems like something happens to the 'stunnel' process when
I exit 'ssh' on Cygwin.

> The advantage of using ProxyCommand in your ssh config is that it starts a
 > separate stunnel process for each connection, which should avoid this problem.
 > 
 > If you don't usually need stunnel, you can create one two ssh configurations
 > with different names, one with ProxyCommand and one without, and use whichever
 > one you need.
 > 
Definitely a possible solution though I would like to forget why it
 isn't working normally on Cygwin.


More information about the Cygwin mailing list