3

I installed inetutils on my cygwin this afternoon, and since then my sshd hasn't worked anymore. Here's the message from ssh client

$ ssh localhost
sh_exchange_identification: read: Connection reset by peer

However, while I stopped sshd cygrunsrv --stop sshd and typed /usr/sbin/sshd -d to invoke the service, it works well!!

$ /usr/sbin/sshd.exe -d
debug1: sshd version OpenSSH_7.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: private host key #0: ssh-rsa SHA256:Rz3HKh2PjpOcKyX8sjyMGhb/Q1vDfL91thgvDR2HNZk
debug1: private host key #1: ssh-dss SHA256:DactSa4Y4tyqA0zs6qhDEK8hKfBAot3GU/Ed2zlnR+w
debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:Pxf9wMqGnt5WR45elqFiL//RlmWITyM93XLu/kiw8Mg
debug1: private host key #3: ssh-ed25519 SHA256:6VkIIMYwB7DsAUZHvE0XQPpD9k2a8TfKlbOmX3Ij6ZM
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: 3, 3
Connection from ::1 port 5242 on ::1 port 22
debug1: Client protocol version 2.0; client software version OpenSSH_7.2
debug1: match: OpenSSH_7.2 pat OpenSSH* compat 0x04000000
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_INIT
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: KEX done
debug1: userauth-request for user rilakkris service ssh-connection method none
debug1: attempt 0 failures 0
Failed none for rilakkris from ::1 port 5242 ssh2
debug1: userauth-request for user rilakkris service ssh-connection method keyboard-interactive
debug1: attempt 1 failures 0
debug1: keyboard-interactive devs
debug1: auth2_challenge: user=rilakkris devs=
debug1: kbdint_alloc: devices ''
Failed keyboard-interactive for rilakkris from ::1 port 5242 ssh2
debug1: userauth-request for user rilakkris service ssh-connection method password
debug1: attempt 2 failures 1
Accepted password for rilakkris from ::1 port 5242 ssh2
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch_20
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.
debug1: session_pty_req: session 0 alloc /dev/pty2
debug1: server_input_channel_req: channel 0 request shell reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req shell
Starting session: shell on pty2 for rilakkris from ::1 port 5242 id 0
debug1: Setting controlling tty using TIOCSCTTY.

I don't know how to trace the problem. May there be anything wrong with the connection like iptables? It looks like there's no iptables on cygwin. Any ideas? Thanks a lot!

  • what do the server logs tell you? – Jakuje Mar 23 '16 at 15:56
  • If you'd used cygrunsrv --start sshd instead of running it manually, would it have worked then? Might be it just needed restarting. – ams Mar 23 '16 at 15:58
  • I'm having the same problem on Windows 7 Professional. The Windows Event Viewer shows nothing except that the sshd service started. I get "ssh_exchange_identification: read: Connection reset by peer" both when I try to connect locally and remotely. – hourback Mar 25 '16 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.