delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/02/19/12:16:18

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E41E73858D1E
Authentication-Results: sourceware.org;
dmarc=pass (p=none dis=none) header.from=gmail.com
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:from:date:message-id:subject:to;
bh=49b0znTEMCUbngk7cfQPKXuYt/pUBSNZddbfiI3xipg=;
b=pw2Qmx7Cy3r5DZOm661YxQTb8+ulhYyqQoSFTX717k9cpM4+FGz6++KsfVZMz3Fi5u
FjMSnjPrzA1kq+h/zMKNBeh/6gJhHSzkp4mQZduflqABIofhYpJsCFL6ZODVo4B+046W
/QSNw6jnStT+tA/Y24NqrBBW6bxJcLNf4XrqRKXzWuvo8Phm0glXap/ZzMsP8tuqcHtP
9AxXDruVezZl9cHJJbAMJRwqyMw+gCljGRFruOD8aNyab6Hrjzr+W/55oDLHJSd2sk+e
MOw0kjnFCCZpNP7xJTYBGFNMx7GD+Cyt6lqiEoRJJSDQryJt8M/2bhUQy6ch6oGB1rzN
PBfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=49b0znTEMCUbngk7cfQPKXuYt/pUBSNZddbfiI3xipg=;
b=NXLRhaj3Bu7Tb42o5n7qi0gtU6iwnFEl7mqZpck8gQEpEKKjc7+F4vt16EQbIeSTbN
xiUkby3C3V+aTXxNCLUF9lT2r+vAGdifzS6p+4XdDLLmrKL5LtSBAYH3LjptS4b3qK+0
bGEVllKKM1X4W8+/Ure8OnCznKv/1MKOkOQuZcIFp5Ev1mqyR1JcvjAfSPjFA/RApgag
hxnblQemMLguRHLuzB5kte2aJ7ppaljV04jjSPStpigp4kdeYbMJSVR5/whRNibgyDzM
SF9HbypZ7A/MwsOqEI+s+Cz6MF6KHhsvrgrUihDGxQV1bRbI/G+6sLkQxgHd0pYSPL6c
QqKw==
X-Gm-Message-State: AOAM531ouP4KHAaDkKG6c3fkhdhe7OG6+Rfp7RW153bb5oMtj4/FdOPT
OwQ4auMEAvjBB56S4mKRQbI77KZpj0C4fCBay2DSBDnCorQ=
X-Google-Smtp-Source: ABdhPJyS7KW7qkyqIAaYUHgukkbeENYoWL9ObycgzwIiQpXDfvZqheFD97m8IGxoSjV8U/uy3CPJTs/S+P91U6s5lWI=
X-Received: by 2002:aa7:d403:0:b0:40f:739c:cbae with SMTP id
z3-20020aa7d403000000b0040f739ccbaemr13895497edq.267.1645290955588; Sat, 19
Feb 2022 09:15:55 -0800 (PST)
MIME-Version: 1.0
From: Sanjay Gupta <sanjay92 AT gmail DOT com>
Date: Sat, 19 Feb 2022 09:15:43 -0800
Message-ID: <CANbXC7Mi8u=p7+34=OqFowzF+kqgKdnJ-anh4sGjaun3vQQz8g@mail.gmail.com>
Subject: cygwin ssh connection from mac to windows Connection closed by
XX.XX.XXX.XX port 22
To: cygwin AT cygwin DOT com
X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT,
FREEMAIL_FROM, HTML_MESSAGE, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,
SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE,
WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

Cygwin SSH Server runs on Win 10. SSH is running as a service and using
local system account as Logon property.

I can successfully login using putty on Win 10 ( connection to localhost
and providing password when asked) so this works.

Same when I try to connect from MAC, I get error Connection closed by
XX.XX.XXX.XX port 22

ssh -v -v -v  user AT mypc DOT com
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/macuser/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: /etc/ssh/ssh_config line 51: Applying options for *
debug1: Connecting to mypc.com port 22.
debug1: Connection established.
debug1: identity file /Users/macuser/.ssh/id_rsa type 0
debug1: identity file /Users/macuser/.ssh/id_rsa-cert type -1
debug1: identity file /Users/macuser/.ssh/id_dsa type -1
debug1: identity file /Users/macuser/.ssh/id_dsa-cert type -1
debug1: identity file /Users/macuser/.ssh/id_ecdsa type -1
debug1: identity file /Users/macuser/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/macuser/.ssh/id_ed25519 type -1
debug1: identity file /Users/macuser/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/macuser/.ssh/id_xmss type -1
debug1: identity file /Users/macuser/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.8
debug1: match: OpenSSH_8.8 pat OpenSSH* compat 0x04000000
debug3: fd 5 is O_NONBLOCK
debug1: Authenticating to mypc.com:22 as 'user'
debug3: hostkeys_foreach: reading file "/Users/macuser/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file
/Users/macuser/.ssh/known_hosts:311
debug3: load_hostkeys: loaded 1 keys from mypc.com
debug3: order_hostkeyalgs: prefer hostkeyalgs:
ecdsa-sha2-nistp256-cert-v01 AT openssh DOT com,ecdsa-sha2-nistp384-cert-v01 AT openssh DOT com,ecdsa-sha2-nistp521-cert-v01 AT openssh DOT com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms:
curve25519-sha256,curve25519-sha256 AT libssh DOT org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms:
ecdsa-sha2-nistp256-cert-v01 AT openssh DOT com,ecdsa-sha2-nistp384-cert-v01 AT openssh DOT com,ecdsa-sha2-nistp521-cert-v01 AT openssh DOT com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01 AT openssh DOT com,rsa-sha2-512-cert-v01 AT openssh DOT com,rsa-sha2-256-cert-v01 AT openssh DOT com,ssh-rsa-cert-v01 AT openssh DOT com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos:
chacha20-poly1305 AT openssh DOT com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm AT openssh DOT com,aes256-gcm AT openssh DOT com
debug2: ciphers stoc:
chacha20-poly1305 AT openssh DOT com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm AT openssh DOT com,aes256-gcm AT openssh DOT com
debug2: MACs ctos:
umac-64-etm AT openssh DOT com,umac-128-etm AT openssh DOT com,hmac-sha2-256-etm AT openssh DOT com,hmac-sha2-512-etm AT openssh DOT com,hmac-sha1-etm AT openssh DOT com,umac-64 AT openssh DOT com,umac-128 AT openssh DOT com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc:
umac-64-etm AT openssh DOT com,umac-128-etm AT openssh DOT com,hmac-sha2-256-etm AT openssh DOT com,hmac-sha2-512-etm AT openssh DOT com,hmac-sha1-etm AT openssh DOT com,umac-64 AT openssh DOT com,umac-128 AT openssh DOT com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib AT openssh DOT com,zlib
debug2: compression stoc: none,zlib AT openssh DOT com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms:
curve25519-sha256,curve25519-sha256 AT libssh DOT org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1
debug2: host key algorithms:
rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos:
chacha20-poly1305 AT openssh DOT com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm AT openssh DOT com,aes256-gcm AT openssh DOT com
debug2: ciphers stoc:
chacha20-poly1305 AT openssh DOT com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm AT openssh DOT com,aes256-gcm AT openssh DOT com
debug2: MACs ctos:
umac-64-etm AT openssh DOT com,umac-128-etm AT openssh DOT com,hmac-sha2-256-etm AT openssh DOT com,hmac-sha2-512-etm AT openssh DOT com,hmac-sha1-etm AT openssh DOT com,umac-64 AT openssh DOT com,umac-128 AT openssh DOT com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc:
umac-64-etm AT openssh DOT com,umac-128-etm AT openssh DOT com,hmac-sha2-256-etm AT openssh DOT com,hmac-sha2-512-etm AT openssh DOT com,hmac-sha1-etm AT openssh DOT com,umac-64 AT openssh DOT com,umac-128 AT openssh DOT com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib AT openssh DOT com
debug2: compression stoc: none,zlib AT openssh DOT com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305 AT openssh DOT com MAC:
<implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305 AT openssh DOT com MAC:
<implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256
SHA256:oD2hFa/JcjHe/xayDBUYl1my190rrIGcKIniYl+hpfA
debug3: hostkeys_foreach: reading file "/Users/macuser/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file
/Users/macuser/.ssh/known_hosts:311
debug3: load_hostkeys: loaded 1 keys from mypc.com
debug3: hostkeys_foreach: reading file "/Users/macuser/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file
/Users/macuser/.ssh/known_hosts:311
debug3: load_hostkeys: loaded 1 keys from 10.60.193.69
debug1: Host 'mypc.com' is known and matches the ECDSA host key.
debug1: Found key in /Users/macuser/.ssh/known_hosts:311
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/macuser/.ssh/id_rsa RSA
SHA256:+7RTuPPGLQgUGUIU+fdAoxnhvZ1cy77GTzniJV8qyWQ
debug1: Will attempt key: /Users/macuser/.ssh/id_dsa
debug1: Will attempt key: /Users/macuser/.ssh/id_ecdsa
debug1: Will attempt key: /Users/macuser/.ssh/id_ed25519
debug1: Will attempt key: /Users/macuser/.ssh/id_xmss
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info:
server-sig-algs=<ssh-ed25519,sk-ssh-ed25519 AT openssh DOT com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256 AT openssh DOT com,webauthn-sk-ecdsa-sha2-nistp256 AT openssh DOT com>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue:
publickey,password,keyboard-interactive
debug3: start over, passed a different list
publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/macuser/.ssh/id_rsa RSA
SHA256:+7RTuPPGLQgUGUIU+fdAoxnhvZ1cy77GTzniJV8qyWQ
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
Connection closed by XX.XX.XXX.XX port 22

Interestingly, if I stop windows service and manually run
/usr/sbin/sshd.exe -D and then I try to connect from MAC, it works So
obviously looks like some issue with service and may be system account. But
then I have changed service to run as my Domain account but same issue

I have also uninstalled and reinstalled sshd service couple of times as
well but did not help issue. I have also checked whether port no 22 is
getting blocked or not but does not seems like it.

telnet mycygwinserver.com 22
Trying XX.XX.XXX.XX...
Connected to mycygwinserver.com.
Escape character is '^]'.
SSH-2.0-OpenSSH_8.8


Enabled syslog-ng and sshd_config log level to debug3

Feb 18 21:18:34 USL37BCPC2 sshd: PID 1188: debug3: mm_key_allowed:
entering [preauth]
Feb 18 21:18:34 USL37BCPC2 sshd: PID 1188: debug3: mm_request_send:
entering, type 22 [preauth]
Feb 18 21:18:34 USL37BCPC2 sshd: PID 1188: debug3: mm_key_allowed:
waiting for MONITOR_ANS_KEYALLOWED [preauth]
Feb 18 21:18:34 USL37BCPC2 sshd: PID 1188: debug3:
mm_request_receive_expect: entering, type 23 [preauth]
Feb 18 21:18:34 USL37BCPC2 sshd: PID 1188: debug3: mm_request_receive:
entering [preauth]
Feb 18 21:18:34 USL37BCPC2 sshd: PID 1188: debug3: mm_request_receive: entering
Feb 18 21:18:34 USL37BCPC2 sshd: PID 1188: debug3: monitor_read:
checking request 22
Feb 18 21:18:34 USL37BCPC2 sshd: PID 1188: debug3:
mm_answer_keyallowed: entering
Feb 18 21:18:34 USL37BCPC2 sshd: PID 1188: debug1:
temporarily_use_uid: 4270411484/4266656257 (e=18/18)
Feb 18 21:18:36 USL37BCPC2 sshd: PID 1188: fatal: seteuid 4270411484:
No such device or address
Feb 18 21:18:36 USL37BCPC2 sshd: PID 1188: debug1: do_cleanup
Feb 18 21:18:36 USL37BCPC2 sshd: PID 1188: debug1: Killing privsep child 1189


Any idea why am I having issues with service vs manual running ?

-- 

Thanks
Sanjay Gupta

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019