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 u...@mypc.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-...@openssh.com,ecdsa-sha2-nistp384-cert-...@openssh.com,ecdsa-sha2-nistp521-cert-...@openssh.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-sha...@libssh.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-...@openssh.com,ecdsa-sha2-nistp384-cert-...@openssh.com,ecdsa-sha2-nistp521-cert-...@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-...@openssh.com,rsa-sha2-512-cert-...@openssh.com,rsa-sha2-256-cert-...@openssh.com,ssh-rsa-cert-...@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa debug2: ciphers ctos: chacha20-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,aes256-...@openssh.com debug2: ciphers stoc: chacha20-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,aes256-...@openssh.com debug2: MACs ctos: umac-64-...@openssh.com,umac-128-...@openssh.com,hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: MACs stoc: umac-64-...@openssh.com,umac-128-...@openssh.com,hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: compression ctos: none,z...@openssh.com,zlib debug2: compression stoc: none,z...@openssh.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-sha...@libssh.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-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,aes256-...@openssh.com debug2: ciphers stoc: chacha20-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,aes256-...@openssh.com debug2: MACs ctos: umac-64-...@openssh.com,umac-128-...@openssh.com,hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: MACs stoc: umac-64-...@openssh.com,umac-128-...@openssh.com,hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: compression ctos: none,z...@openssh.com debug2: compression stoc: none,z...@openssh.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-poly1...@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1...@openssh.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-ed25...@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp...@openssh.com,webauthn-sk-ecdsa-sha2-nistp...@openssh.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