PowerShell / Win32-OpenSSH

Win32 port of OpenSSH
7.42k stars 759 forks source link

ssh ok, but scp got "lost connection" caused by "debug3: ReadFileEx() ERROR:109, io:00000270A87CDA70" #2269

Closed yourchanges closed 1 month ago

yourchanges commented 1 month ago

Prerequisites

Steps to reproduce

I install the win32-openssh server on windows servers 2019 dc, the ssh ok, but scp got "lost connection" caused by "debug3: ReadFileEx() ERROR:109, io:00000270A87CDA70"

Expected behavior

scp works

Actual behavior

scp got lost connection caused by "debug3: ReadFileEx() ERROR:109, io:00000270A87CDA70"

Error details

sshd debug logs:

PS C:\opensshd> .\sshd.exe -ddd
debug2: load_server_config: filename __PROGRAMDATA__\\ssh/sshd_config
debug2: load_server_config: done config len = 159
debug2: parse_server_config: config __PROGRAMDATA__\\ssh/sshd_config len 159
debug3: __PROGRAMDATA__\\ssh/sshd_config:38 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: __PROGRAMDATA__\\ssh/sshd_config:80 setting Subsystem sftp      sftp-server.exe
debug1: sshd version OpenSSH_for_Windows_8.1, LibreSSL 2.9.2
debug1: get_passwd: LookupAccountName() failed: 1332.
debug1: private host key #0: ssh-rsa SHA256:Imh3c5Sw3M485kdEK2MYiz+SZvnefd54rRb6iO3Gp7o
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:TtSlHP++qzjd38fLjpCpGJfTV9J53PUmrvQ4VTfdFs4
debug1: private host key #2: ssh-ed25519 SHA256:6gAAe1oEhVfcD5JmEBaFeg7rTLEQHFrydOqr40jg7Io
debug1: rexec_argv[0]='C:\\opensshd\\sshd.exe'
debug1: rexec_argv[1]='-ddd'
debug2: fd 3 setting O_NONBLOCK
debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug2: fd 4 setting O_NONBLOCK
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug3: fd 5 is not O_NONBLOCK
debug1: Server will not fork when running in debugging mode.
debug3: send_rexec_state: entering fd = 8 config len 159
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
Connection from 10.1.14.151 port 60854 on 192.168.254.89 port 22
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.10
debug1: match: OpenSSH_8.9p1 Ubuntu-3ubuntu0.10 pat OpenSSH* compat 0x04000000
debug2: fd 5 setting O_NONBLOCK
debug3: spawning "C:\\opensshd\\sshd.exe" -ddd -y
debug2: Network child is on pid 8136
debug3: send_rexec_state: entering fd = 4 config len 159
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug3: ssh_msg_send: type 0
debug3: ssh_msg_send: type 0
debug3: preauth child monitor started
debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug3: send packet: type 20 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug3: receive packet: type 20 [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug2: local server KEXINIT proposal [preauth]
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@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 [preauth]
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: compression ctos: none,zlib@openssh.com [preauth]
debug2: compression stoc: none,zlib@openssh.com [preauth]
debug2: languages ctos:  [preauth]
debug2: languages stoc:  [preauth]
debug2: first_kex_follows 0  [preauth]
debug2: reserved 0  [preauth]
debug2: peer client KEXINIT proposal [preauth]
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup761x25519-sha512@openssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c,kex-strict-c-v00@openssh.com [preauth]
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256 [preauth]
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com [preauth]
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth]
debug2: compression ctos: none,zlib@openssh.com,zlib [preauth]
debug2: compression stoc: none,zlib@openssh.com,zlib [preauth]
debug2: languages ctos:  [preauth]
debug2: languages stoc:  [preauth]
debug2: first_kex_follows 0  [preauth]
debug2: reserved 0  [preauth]
debug1: kex: algorithm: curve25519-sha256 [preauth]
debug1: kex: host key algorithm: ssh-ed25519 [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]
debug3: receive packet: type 30 [preauth]
debug3: mm_sshkey_sign entering [preauth]
debug3: mm_request_send entering: type 6 [preauth]
debug3: mm_sshkey_sign: waiting for MONITOR_ANS_SIGN [preauth]
debug3: mm_request_receive_expect entering: type 7 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 6
debug3: mm_answer_sign
debug3: mm_answer_sign: KEX signature 00000270A8784680(83)
debug3: mm_request_send entering: type 7
debug2: monitor_read: 6 used once, disabling now
debug3: send packet: type 31 [preauth]
debug3: send packet: type 21 [preauth]
debug2: set_newkeys: mode 1 [preauth]
debug1: rekey out after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: Sending SSH2_MSG_EXT_INFO [preauth]
debug3: send packet: type 7 [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug3: receive packet: type 21 [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug2: set_newkeys: mode 0 [preauth]
debug1: rekey in after 134217728 blocks [preauth]
debug1: KEX done [preauth]
debug3: receive packet: type 5 [preauth]
debug3: send packet: type 6 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user ch999admin service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug3: mm_getpwnamallow entering [preauth]
debug3: mm_request_send entering: type 8 [preauth]
debug3: mm_getpwnamallow: waiting for MONITOR_ANS_PWNAM [preauth]
debug3: mm_request_receive_expect entering: type 9 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 8
debug3: mm_answer_pwnamallow
debug2: parse_server_config: config reprocess config len 159
debug3: mm_answer_pwnamallow: sending MONITOR_ANS_PWNAM: 1
debug3: mm_request_send entering: type 9
debug2: monitor_read: 8 used once, disabling now
debug2: input_userauth_request: setting up authctxt for ch999admin [preauth]
debug3: mm_inform_authserv entering [preauth]
debug3: mm_request_send entering: type 4 [preauth]
debug2: input_userauth_request: try method none [preauth]
debug3: user_specific_delay: user specific delay 0.000ms [preauth]
debug3: ensure_minimum_time_since: elapsed 15.523ms, delaying 9.453ms (requested 6.244ms) [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 4
debug3: mm_answer_authserv: service=ssh-connection, style=
debug2: monitor_read: 4 used once, disabling now
debug3: userauth_finish: failure partial=0 next methods="publickey,password,keyboard-interactive" [preauth]
debug3: send packet: type 51 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user ch999admin service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug2: input_userauth_request: try method publickey [preauth]
debug2: userauth_pubkey: valid user ch999admin querying public key rsa-sha2-512 AAAAB3x[preauth]
debug1: userauth_pubkey: test pkalg rsa-sha2-512 pkblob RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0 [preauth]
debug3: mm_key_allowed entering [preauth]
debug3: mm_request_send entering: type 22 [preauth]
debug3: mm_key_allowed: waiting for MONITOR_ANS_KEYALLOWED [preauth]
debug3: mm_request_receive_expect entering: type 23 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 22
debug3: mm_answer_keyallowed entering
debug3: mm_answer_keyallowed: key_from_blob: 00000270A87CCD10
debug1: trying public key file C:\\Users\\Administrator\\.ssh/authorized_keys
debug1: C:\\Users\\Administrator\\.ssh/authorized_keys:1: matching key found: RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0
debug1: C:\\Users\\Administrator\\.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
Accepted key RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0 found at C:\\Users\\Administrator\\.ssh/authorized_keys:1
debug3: mm_answer_keyallowed: publickey authentication test: RSA key is allowed
debug3: mm_request_send entering: type 23
debug3: send packet: type 60 [preauth]
debug2: userauth_pubkey: authenticated 0 pkalg rsa-sha2-512 [preauth]
debug3: user_specific_delay: user specific delay 0.000ms [preauth]
debug3: ensure_minimum_time_since: elapsed 31.232ms, delaying 18.719ms (requested 6.244ms) [preauth]
Postponed publickey for ch999admin from 10.1.14.151 port 60854 ssh2 [preauth]
debug3: receive packet: type 50 [preauth]
debug1: userauth-request for user ch999admin service ssh-connection method publickey [preauth]
debug1: attempt 2 failures 0 [preauth]
debug2: input_userauth_request: try method publickey [preauth]
debug2: userauth_pubkey: valid user ch999admin attempting public key rsa-sha2-512 AAAAB3Nzxxx[preauth]
debug3: userauth_pubkey: have rsa-sha2-512 signature for RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0 [preauth]
debug3: mm_key_allowed entering [preauth]
debug3: mm_request_send entering: type 22 [preauth]
debug3: mm_key_allowed: waiting for MONITOR_ANS_KEYALLOWED [preauth]
debug3: mm_request_receive_expect entering: type 23 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 22
debug3: mm_answer_keyallowed entering
debug3: mm_answer_keyallowed: key_from_blob: 00000270A87CCE30
debug1: trying public key file C:\\Users\\Administrator\\.ssh/authorized_keys
debug1: C:\\Users\\Administrator\\.ssh/authorized_keys:1: matching key found: RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0
debug1: C:\\Users\\Administrator\\.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
Accepted key RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0 found at C:\\Users\\Administrator\\.ssh/authorized_keys:1
debug3: mm_answer_keyallowed: publickey authentication: RSA key is allowed
debug3: mm_request_send entering: type 23
debug3: mm_sshkey_verify entering [preauth]
debug3: mm_request_send entering: type 24 [preauth]
debug3: mm_sshkey_verify: waiting for MONITOR_ANS_KEYVERIFY [preauth]
debug3: mm_request_receive_expect entering: type 25 [preauth]
debug3: mm_request_receive entering [preauth]
debug3: mm_request_receive entering
debug3: monitor_read: checking request 24
debug3: mm_answer_keyverify: publickey 00000270A87CCF50 signature verified
debug1: auth_activate_options: setting new authentication options
debug3: mm_request_send entering: type 25
Accepted publickey for ch999admin from 10.1.14.151 port 60854 ssh2: RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0
debug1: monitor_child_preauth: ch999admin has been authenticated by privileged process
debug3: mm_get_keystate: Waiting for new keys
debug3: mm_request_receive_expect entering: type 26
debug3: mm_request_receive entering
debug3: mm_get_keystate: GOT new keys
debug1: auth_activate_options: setting new authentication options [preauth]
debug2: userauth_pubkey: authenticated 1 pkalg rsa-sha2-512 [preauth]
debug3: user_specific_delay: user specific delay 0.000ms [preauth]
debug3: ensure_minimum_time_since: elapsed 31.237ms, delaying 18.714ms (requested 6.244ms) [preauth]
debug3: send packet: type 52 [preauth]
debug3: mm_request_send entering: type 26 [preauth]
debug3: mm_send_keystate: Finished sending state [preauth]
debug3: ReadFileEx() ERROR:109, io:00000270A87CDA70
debug3: read - no more data, io:00000270A87CDA70
debug1: monitor_read_log: child log fd closed
debug3: get_user_token - i am running as ch999admin, returning process token
debug1: Not running as SYSTEM: skipping loading user profile
debug3: spawning "C:\\opensshd\\sshd.exe" -ddd -z
User child is on pid 5796
debug3: send_rexec_state: entering fd = 6 config len 159
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug3: ssh_msg_send: type 0
debug3: ssh_msg_send: type 0
debug3: ssh_msg_send: type 0
debug3: ssh_msg_send: type 0
debug3: ssh_msg_send: type 0
debug3: mm_request_receive entering
debug3: monitor_read: checking request 6
debug3: mm_answer_sign
debug3: mm_answer_sign: hostkey proof signature 00000270A87FAD60(399)
debug3: mm_request_send entering: type 7
debug3: mm_request_receive entering
debug1: do_cleanup
PS C:\opensshd>

scp client debug logs:

scp -vvv  1.gif ch999admin@192.168.254.89:/d/soft/
Executing: program /usr/bin/ssh host 192.168.254.89, user ch999admin, command scp -v -t /d/soft/
OpenSSH_8.9p1 Ubuntu-3ubuntu0.10, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/lee/.ssh/config
debug3: kex names ok: [diffie-hellman-group1-sha1]
debug3: kex names ok: [diffie-hellman-group1-sha1]
debug3: kex names ok: [diffie-hellman-group1-sha1]
debug3: kex names ok: [diffie-hellman-group1-sha1]
debug3: kex names ok: [diffie-hellman-group14-sha1]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolve_canonicalize: hostname 192.168.254.89 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/lee/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/lee/.ssh/known_hosts2'
debug3: ssh_connect_direct: entering
debug1: Connecting to 192.168.254.89 [192.168.254.89] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: Connection established.
debug1: identity file /home/lee/.ssh/id_rsa type 0
debug1: identity file /home/lee/.ssh/id_rsa-cert type -1
debug1: identity file /home/lee/.ssh/id_ecdsa type -1
debug1: identity file /home/lee/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/lee/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/lee/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/lee/.ssh/id_ed25519 type -1
debug1: identity file /home/lee/.ssh/id_ed25519-cert type -1
debug1: identity file /home/lee/.ssh/id_ed25519_sk type -1
debug1: identity file /home/lee/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/lee/.ssh/id_xmss type -1
debug1: identity file /home/lee/.ssh/id_xmss-cert type -1
debug1: identity file /home/lee/.ssh/id_dsa type -1
debug1: identity file /home/lee/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.10
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.1
debug1: compat_banner: match: OpenSSH_for_Windows_8.1 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.254.89:22 as 'ch999admin'
debug3: record_hostkey: found key type ED25519 in file /home/lee/.ssh/known_hosts:767
debug3: record_hostkey: found key type ECDSA in file /home/lee/.ssh/known_hosts:768
debug3: load_hostkeys_file: loaded 2 keys from 192.168.254.89
debug1: load_hostkeys: fopen /home/lee/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug3: order_hostkeyalgs: have matching best-preference key type ssh-ed25519-cert-v01@openssh.com, using HostkeyAlgorithms verbatim
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@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup761x25519-sha512@openssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c,kex-strict-c-v00@openssh.com
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@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-sha256@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
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@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: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:6gAAe1oEhVfcD5JmEBaFeg7rTLEQHFrydOqr40jg7Io
debug3: record_hostkey: found key type ED25519 in file /home/lee/.ssh/known_hosts:767
debug3: record_hostkey: found key type ECDSA in file /home/lee/.ssh/known_hosts:768
debug3: load_hostkeys_file: loaded 2 keys from 192.168.254.89
debug1: load_hostkeys: fopen /home/lee/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host '192.168.254.89' is known and matches the ED25519 host key.
debug1: Found key in /home/lee/.ssh/known_hosts:767
debug3: send packet: type 21
debug2: ssh_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: ssh_set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/lee/.ssh/id_rsa RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0
debug1: Will attempt key: /home/lee/.ssh/id_ecdsa 
debug1: Will attempt key: /home/lee/.ssh/id_ecdsa_sk 
debug1: Will attempt key: /home/lee/.ssh/id_ed25519 
debug1: Will attempt key: /home/lee/.ssh/id_ed25519_sk 
debug1: Will attempt key: /home/lee/.ssh/id_xmss 
debug1: Will attempt key: /home/lee/.ssh/id_dsa 
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,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
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 gssapi-with-mic,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: /home/lee/.ssh/id_rsa RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: /home/lee/.ssh/id_rsa RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0
debug3: sign_and_send_pubkey: using publickey with RSA SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0
debug3: sign_and_send_pubkey: signing using rsa-sha2-512 SHA256:MHOETfWCqIYHYcCs6uMzkJeEJgzjIzlnciNl48aIua0
debug3: send packet: type 50
debug3: receive packet: type 52
Authenticated to 192.168.254.89 ([192.168.254.89]:22) using "publickey".
debug2: fd 4 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: filesystem
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: client_input_hostkeys: received RSA key SHA256:Imh3c5Sw3M485kdEK2MYiz+SZvnefd54rRb6iO3Gp7o
debug3: client_input_hostkeys: received ECDSA key SHA256:TtSlHP++qzjd38fLjpCpGJfTV9J53PUmrvQ4VTfdFs4
debug3: client_input_hostkeys: received ED25519 key SHA256:6gAAe1oEhVfcD5JmEBaFeg7rTLEQHFrydOqr40jg7Io
debug1: client_input_hostkeys: searching /home/lee/.ssh/known_hosts for 192.168.254.89 / (none)
debug3: hostkeys_foreach: reading file "/home/lee/.ssh/known_hosts"
debug3: hostkeys_find: found ssh-ed25519 key at /home/lee/.ssh/known_hosts:767
debug3: hostkeys_find: found ecdsa-sha2-nistp256 key at /home/lee/.ssh/known_hosts:768
debug1: client_input_hostkeys: searching /home/lee/.ssh/known_hosts2 for 192.168.254.89 / (none)
debug1: client_input_hostkeys: hostkeys file /home/lee/.ssh/known_hosts2 does not exist
debug3: client_input_hostkeys: 3 server keys: 1 new, 1 retained, 1 incomplete match. 0 to remove
debug3: client_input_hostkeys: asking server to prove ownership for 1 keys
debug3: send packet: type 80
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: set_sock_tos: set socket 3 IP_TOS 0x08
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug3: Ignored env SHELL
debug3: Ignored env SESSION_MANAGER
debug3: Ignored env WINDOWID
debug3: Ignored env QT_ACCESSIBILITY
debug3: Ignored env COLORTERM
debug3: Ignored env _fzf_orig_completion_tee
debug3: Ignored env XDG_CONFIG_DIRS
debug3: Ignored env _fzf_orig_completion_rm
debug3: Ignored env _fzf_orig_completion_rmdir
debug3: Ignored env XDG_SESSION_PATH
debug3: Ignored env GNOME_DESKTOP_SESSION_ID
debug3: Ignored env GTK_IM_MODULE
debug3: Ignored env MODULAR_HOME
debug3: Ignored env LANGUAGE
debug3: Ignored env _fzf_orig_completion_uniq
debug3: Ignored env MANDATORY_PATH
debug3: Ignored env _fzf_orig_completion_ftp
debug3: Ignored env JAVA_HOME
debug3: Ignored env HISTTIMEFORMAT
debug3: Ignored env GOPRIVATE
debug3: Ignored env CINNAMON_VERSION
debug3: Ignored env _fzf_orig_completion_tail
debug3: Ignored env SHELL_SESSION_ID
debug3: Ignored env XMODIFIERS
debug3: Ignored env DESKTOP_SESSION
debug3: Ignored env GTK_MODULES
debug3: Ignored env XDG_SEAT
debug3: Ignored env _fzf_orig_completion_mv
debug3: Ignored env PWD
debug3: Ignored env XDG_SESSION_DESKTOP
debug3: Ignored env LOGNAME
debug3: Ignored env XDG_SESSION_TYPE
debug3: Ignored env GPG_AGENT_INFO
debug3: Ignored env XAUTHORITY
debug3: Ignored env XDG_GREETER_DATA_DIR
debug3: Ignored env GJS_DEBUG_TOPICS
debug3: Ignored env GDM_LANG
debug3: Ignored env _fzf_orig_completion_diff
debug3: Ignored env HOME
debug1: channel 0: setting env LANG = "zh_CN.UTF-8"
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env _fzf_orig_completion_awk
debug3: Ignored env LS_COLORS
debug3: Ignored env XDG_CURRENT_DESKTOP
debug3: Ignored env _fzf_orig_completion_telnet
debug3: Ignored env KONSOLE_DBUS_SERVICE
debug3: Ignored env KONSOLE_DBUS_SESSION
debug3: Ignored env PROFILEHOME
debug3: Ignored env _fzf_orig_completion_grep
debug3: Ignored env XDG_SEAT_PATH
debug3: Ignored env KONSOLE_VERSION
debug3: Ignored env GOROOT
debug3: Ignored env CLUTTER_IM_MODULE
debug3: Ignored env _fzf_orig_completion_du
debug3: Ignored env _fzf_orig_completion_sort
debug3: Ignored env GJS_DEBUG_OUTPUT
debug3: Ignored env NVM_DIR
debug3: Ignored env LESSCLOSE
debug3: Ignored env XDG_SESSION_CLASS
debug3: Ignored env _fzf_orig_completion_cat
debug3: Ignored env TERM
debug3: Ignored env DEFAULTS_PATH
debug3: Ignored env LESSOPEN
debug3: Ignored env _fzf_orig_completion_ln
debug3: Ignored env _fzf_orig_completion_scp
debug3: Ignored env USER
debug3: Ignored env _fzf_orig_completion_ld
debug3: Ignored env LE_WORKING_DIR
debug3: Ignored env COLORFGBG
debug3: Ignored env _fzf_orig_completion_ls
debug3: Ignored env MAVEN_HOME
debug3: Ignored env GOPROXY
debug3: Ignored env DISPLAY
debug3: Ignored env SHLVL
debug3: Ignored env NVM_CD_FLAGS
debug3: Ignored env QT_IM_MODULE
debug3: Ignored env XDG_VTNR
debug3: Ignored env _fzf_orig_completion_pushd
debug3: Ignored env XDG_SESSION_ID
debug3: Ignored env CLASSPATH
debug3: Ignored env _fzf_orig_completion_vim
debug3: Ignored env XDG_RUNTIME_DIR
debug3: Ignored env _fzf_orig_completion_cd
debug3: Ignored env _fzf_orig_completion_less
debug3: Ignored env GTK3_MODULES
debug3: Ignored env XDG_DATA_DIRS
debug3: Ignored env _fzf_orig_completion_cp
debug3: Ignored env PATH
debug3: Ignored env GDMSESSION
debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
debug3: Ignored env _fzf_orig_completion_sed
debug3: Ignored env NVM_BIN
debug3: Ignored env GIO_LAUNCHED_DESKTOP_FILE_PID
debug3: Ignored env _fzf_orig_completion_head
debug3: Ignored env GIO_LAUNCHED_DESKTOP_FILE
debug3: Ignored env _fzf_orig_completion_wc
debug3: Ignored env GOPATH
debug3: Ignored env KONSOLE_DBUS_WINDOW
debug3: Ignored env _
debug1: Sending command: scp -v -t /d/soft/
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 81
debug1: client_global_hostkeys_private_confirm: server used untrusted RSA signature algorithm ssh-rsa for key 0, disregarding
debug3: hostkeys_foreach: reading file "/home/lee/.ssh/known_hosts"
debug3: host_delete: ED25519 key already at /home/lee/.ssh/known_hosts:767
debug3: host_delete: ECDSA key already at /home/lee/.ssh/known_hosts:768
debug1: update_known_hosts: known hosts file /home/lee/.ssh/known_hosts2 does not exist
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
scp: debug1: fd 3 clearing O_NONBLOCK
Sending file modes: C0664 381140 1.gif
debug3: receive packet: type 96
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: chan_shutdown_write: channel 0: (i0 o1 sock -1 wfd 5 efd 6 [write])
debug2: channel 0: output drain -> closed
debug3: receive packet: type 98
lost connection
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug2: chan_shutdown_read: channel 0: (i0 o3 sock -1 wfd 4 efd 6 [write])
debug2: channel 0: input open -> closed
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/6 sock -1 cc -1 io 0x00/0x00)

debug3: send packet: type 1
Transferred: sent 4192, received 3312 bytes, in 0.4 seconds
Bytes per second: sent 9562.8, received 7555.4
debug1: Exit status 0

### Environment data

```PowerShell
- windows server dc 2019
- both on v8.1.0.0p1-Beta and v9.5.0.0p1-Beta

Version

both on v8.1.0.0p1-Beta and v9.5.0.0p1-Beta

Visuals

No response

yourchanges commented 1 month ago

C:\opensshd\ is already in the %PATH%

yourchanges commented 1 month ago

solved by "replace my c:\git\usr\bin\scp.exe with the c:\opensshd\scp.exe" , because they are two different version, and my default shell is the bash set by following commands:

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\git\bin\bash.exe" -PropertyType String -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShellCommandOption -Value "" -PropertyType String -Force