public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* sshd sessions hang after cygwin1.dll 3.0.7
@ 2020-01-30 16:28 Bill Stewart
  2020-01-30 16:46 ` Takashi Yano
  0 siblings, 1 reply; 6+ messages in thread
From: Bill Stewart @ 2020-01-30 16:28 UTC (permalink / raw)
  To: cygwin

I have created an OpenSSH installer for Windows users:

https://github.com/Bill-Stewart/Cygwin-OpenSSH

Basically it includes only the minimum files from Cygwin needed to run
OpenSSH and has some additional conveniences (the foremost of which is
to automatically install the service).

The problem:

When I use cygwin1.dll versions newer than 3.0.7, sshd.exe hangs
whenever establishing a connection. Following is the output from 'sshd
-d':

debug1: sshd version OpenSSH_8.1, OpenSSL 1.1.1d  10 Sep 2019
debug1: private host key #0: ssh-rsa SHA256:...
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:...
debug1: private host key #2: ssh-ed25519 SHA256:...
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: fd 5 clearing O_NONBLOCK
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
debug1: inetd sockets after dupping: 4, 4
Connection from <remoteip> port 52466 on <localip> port 22
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.0
debug1: match: OpenSSH_8.0 pat OpenSSH* compat 0x04000000
debug1: permanently_set_uid: 197767/197121 [preauth]
debug1: list_hostkey_types:
rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
[preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: curve25519-sha256 [preauth]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC:
<implicit> compression: none [preauth]
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC:
<implicit> compression: none [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug1: rekey out after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: Sending SSH2_MSG_EXT_INFO [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: rekey in after 134217728 blocks [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user <username> service ssh-connection
method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: user <username> matched 'User <username>' at line 142
debug1: authentication methods list 0: password
debug1: userauth_send_banner: sent [preauth]
debug1: authentication methods list 0: password [preauth]
debug1: userauth-request for user <username> service ssh-connection
method password [preauth]
debug1: attempt 1 failures 0 [preauth]
Accepted password for <username> from <remoteip> port 52466 ssh2
debug1: monitor_child_preauth: <username> has been authenticated by
privileged process
debug1: monitor_read_log: child log fd closed
debug1: rekey in after 134217728 blocks
debug1: rekey out after 134217728 blocks
debug1: ssh_packet_set_postauth: called
debug1: active: key options: agent-forwarding port-forwarding pty
user-rc x11-forwarding
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch
debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_global_request: rtype
no-more-sessions@openssh.com want_reply 0
debug1: server_input_channel_req: channel 0 request pty-req reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req pty-req
debug1: Allocating pty.

The only resolution is to forcibly terminate the spawned copy of sshd
(the one spawned by the 'sshd -d' process).

Server is running Windows 10 v1909.

I have tested, and the hang occurs in all versions of cygwin1.dll after 3.0.7.

When I revert back to cygwin1.dll 3.0.7, the problem does not occur,
and the connection succeeds.

Any ideas?

Thanks!

Bill

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: sshd sessions hang after cygwin1.dll 3.0.7
  2020-01-30 16:28 sshd sessions hang after cygwin1.dll 3.0.7 Bill Stewart
@ 2020-01-30 16:46 ` Takashi Yano
  2020-01-30 19:34   ` Bill Stewart
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Yano @ 2020-01-30 16:46 UTC (permalink / raw)
  To: cygwin

On Thu, 30 Jan 2020 09:27:34 -0700
Bill Stewart wrote:
> I have created an OpenSSH installer for Windows users:
> 
> https://github.com/Bill-Stewart/Cygwin-OpenSSH
> 
> Basically it includes only the minimum files from Cygwin needed to run
> OpenSSH and has some additional conveniences (the foremost of which is
> to automatically install the service).
> 
> The problem:
> 
> When I use cygwin1.dll versions newer than 3.0.7, sshd.exe hangs
> whenever establishing a connection. Following is the output from 'sshd
> -d':
> 
> debug1: sshd version OpenSSH_8.1, OpenSSL 1.1.1d  10 Sep 2019
> debug1: private host key #0: ssh-rsa SHA256:...
> debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:...
> debug1: private host key #2: ssh-ed25519 SHA256:...
> debug1: rexec_argv[0]='/usr/sbin/sshd'
> debug1: rexec_argv[1]='-d'
> debug1: Bind to port 22 on ::.
> Server listening on :: port 22.
> debug1: Bind to port 22 on 0.0.0.0.
> Server listening on 0.0.0.0 port 22.
> debug1: fd 5 clearing O_NONBLOCK
> debug1: Server will not fork when running in debugging mode.
> debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
> debug1: inetd sockets after dupping: 4, 4
> Connection from <remoteip> port 52466 on <localip> port 22
> debug1: Local version string SSH-2.0-OpenSSH_8.1
> debug1: Remote protocol version 2.0, remote software version OpenSSH_8.0
> debug1: match: OpenSSH_8.0 pat OpenSSH* compat 0x04000000
> debug1: permanently_set_uid: 197767/197121 [preauth]
> debug1: list_hostkey_types:
> rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
> [preauth]
> debug1: SSH2_MSG_KEXINIT sent [preauth]
> debug1: SSH2_MSG_KEXINIT received [preauth]
> debug1: kex: algorithm: curve25519-sha256 [preauth]
> debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
> debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC:
> <implicit> compression: none [preauth]
> debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC:
> <implicit> compression: none [preauth]
> debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
> debug1: rekey out after 134217728 blocks [preauth]
> debug1: SSH2_MSG_NEWKEYS sent [preauth]
> debug1: Sending SSH2_MSG_EXT_INFO [preauth]
> debug1: expecting SSH2_MSG_NEWKEYS [preauth]
> debug1: SSH2_MSG_NEWKEYS received [preauth]
> debug1: rekey in after 134217728 blocks [preauth]
> debug1: KEX done [preauth]
> debug1: userauth-request for user <username> service ssh-connection
> method none [preauth]
> debug1: attempt 0 failures 0 [preauth]
> debug1: user <username> matched 'User <username>' at line 142
> debug1: authentication methods list 0: password
> debug1: userauth_send_banner: sent [preauth]
> debug1: authentication methods list 0: password [preauth]
> debug1: userauth-request for user <username> service ssh-connection
> method password [preauth]
> debug1: attempt 1 failures 0 [preauth]
> Accepted password for <username> from <remoteip> port 52466 ssh2
> debug1: monitor_child_preauth: <username> has been authenticated by
> privileged process
> debug1: monitor_read_log: child log fd closed
> debug1: rekey in after 134217728 blocks
> debug1: rekey out after 134217728 blocks
> debug1: ssh_packet_set_postauth: called
> debug1: active: key options: agent-forwarding port-forwarding pty
> user-rc x11-forwarding
> debug1: Entering interactive session for SSH2.
> debug1: server_init_dispatch
> debug1: server_input_channel_open: ctype session rchan 0 win 1048576 max 16384
> debug1: input_session_request
> debug1: channel 0: new [server-session]
> debug1: session_new: session 0
> debug1: session_open: channel 0
> debug1: session_open: session 0: link with channel 0
> debug1: server_input_channel_open: confirm session
> debug1: server_input_global_request: rtype
> no-more-sessions@openssh.com want_reply 0
> debug1: server_input_channel_req: channel 0 request pty-req reply 1
> debug1: session_by_channel: session 0 channel 0
> debug1: session_input_channel_req: session 0 req pty-req
> debug1: Allocating pty.
> 
> The only resolution is to forcibly terminate the spawned copy of sshd
> (the one spawned by the 'sshd -d' process).
> 
> Server is running Windows 10 v1909.
> 
> I have tested, and the hang occurs in all versions of cygwin1.dll after 3.0.7.
> 
> When I revert back to cygwin1.dll 3.0.7, the problem does not occur,
> and the connection succeeds.
> 
> Any ideas?

You need cygwin-console-helper.exe for newer cygwin pty which
supports pseudo console.

I believe you do not need winpty anymore because newer cygwin
utilizes pseudo console in pty.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: sshd sessions hang after cygwin1.dll 3.0.7
  2020-01-30 16:46 ` Takashi Yano
@ 2020-01-30 19:34   ` Bill Stewart
  2020-01-30 20:35     ` Bill Stewart
  2020-01-30 23:24     ` Takashi Yano
  0 siblings, 2 replies; 6+ messages in thread
From: Bill Stewart @ 2020-01-30 19:34 UTC (permalink / raw)
  To: cygwin

On Thu, Jan 30, 2020 at 9:46 AM Takashi Yano wrote:

> Bill Stewart wrote:
> >
> > When I use cygwin1.dll versions newer than 3.0.7, sshd.exe hangs
> > whenever establishing a connection.
> > ...
> > Any ideas?
>
> You need cygwin-console-helper.exe for newer cygwin pty which
> supports pseudo console.
>
> I believe you do not need winpty anymore because newer cygwin
> utilizes pseudo console in pty.

Excellent, thank you!

I added cygwin-console-helper.exe and this resolved it, at least on
Windows 10. My next step is to test on Server 2012 R2.

Since this package is still used for older OS versions, I will still
need winpty for now.

Thanks!

Bill

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: sshd sessions hang after cygwin1.dll 3.0.7
  2020-01-30 19:34   ` Bill Stewart
@ 2020-01-30 20:35     ` Bill Stewart
  2020-01-30 23:24     ` Takashi Yano
  1 sibling, 0 replies; 6+ messages in thread
From: Bill Stewart @ 2020-01-30 20:35 UTC (permalink / raw)
  To: cygwin

On Thu, Jan 30, 2020 at 12:33 PM Bill Stewart wrote:

> I added cygwin-console-helper.exe and this resolved it, at least on
> Windows 10. My next step is to test on Server 2012 R2.

Tested, and works fine also on Server 2012 R2. Thanks for the help!

Bill

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: sshd sessions hang after cygwin1.dll 3.0.7
  2020-01-30 19:34   ` Bill Stewart
  2020-01-30 20:35     ` Bill Stewart
@ 2020-01-30 23:24     ` Takashi Yano
  2020-01-30 23:34       ` Bill Stewart
  1 sibling, 1 reply; 6+ messages in thread
From: Takashi Yano @ 2020-01-30 23:24 UTC (permalink / raw)
  To: cygwin

On Thu, 30 Jan 2020 12:33:28 -0700
Bill Stewart wrote:
> On Thu, Jan 30, 2020 at 9:46 AM Takashi Yano wrote:
> > I believe you do not need winpty anymore because newer cygwin
> > utilizes pseudo console in pty.
> 
> Since this package is still used for older OS versions, I will still
> need winpty for now.

Indeed. I was rash.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: sshd sessions hang after cygwin1.dll 3.0.7
  2020-01-30 23:24     ` Takashi Yano
@ 2020-01-30 23:34       ` Bill Stewart
  0 siblings, 0 replies; 6+ messages in thread
From: Bill Stewart @ 2020-01-30 23:34 UTC (permalink / raw)
  To: cygwin

Thank you for the assistance!

I released the latest version of my installer, now available (under
"Releases" tab) here:

https://github.com/Bill-Stewart/Cygwin-OpenSSH

Bill

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-30 23:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 16:28 sshd sessions hang after cygwin1.dll 3.0.7 Bill Stewart
2020-01-30 16:46 ` Takashi Yano
2020-01-30 19:34   ` Bill Stewart
2020-01-30 20:35     ` Bill Stewart
2020-01-30 23:24     ` Takashi Yano
2020-01-30 23:34       ` Bill Stewart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).