PowerShell / PowerShell/Win32-OpenSSH
Openssh-v8.9.1.0 Qin64 - client_loop: send disconnect: Connection reset
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 8.3k
- Forks
- 819
- PR merge metrics
- No merged PRs in 30d
Description
I need to connect openssh server with public-private key authentication. Connection is working fine with username-password but it is not working with public-private key authentication.
Server is throwing client_loop: send disconnect: Connection reset error while connecting through public-private key authentication, but it is not throwing any error with username-password.
I am new to this area. It will be much helpful if anyone can provide me any clue on this issue.
Please find below debug log details of ssh -v localhost command
Authentication with public-private key
PS C:\WINDOWS\system32> ssh -v localhost
OpenSSH_for_Windows_8.9p1, LibreSSL 3.4.3
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\Username/.ssh/id_rsa type 0
debug1: identity file C:\\Users\\Username/.ssh/id_rsa-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ecdsa type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ecdsa_sk type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ed25519 type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ed25519-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ed25519_sk type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ed25519_sk-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_xmss type -1
debug1: identity file C:\\Users\\Username/.ssh/id_xmss-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_dsa type -1
debug1: identity file C:\\Users\\Username/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.9
debug1: compat_banner: match: OpenSSH_for_Windows_8.9 pat OpenSSH* compat 0x04000000
debug1: Authenticating to localhost:22 as 'domain-name\\Username'
debug1: load_hostkeys: fopen C:\\Users\\Username/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
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
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:***/9SJT/tRtzo
debug1: load_hostkeys: fopen C:\\Users\\Username/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'localhost' is known and matches the ED25519 host key.
debug1: Found key in C:\\Users\\Username/.ssh/known_hosts:3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: get_agent_identities: ssh_fetch_identitylist: agent contains no identities
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_rsa RSA SHA256:***/pJlFQ/8rmt/***/***
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_ecdsa
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_ecdsa_sk
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_ed25519
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_ed25519_sk
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_xmss
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_dsa
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: kex_input_ext_info: publickey-hostbound@openssh.com=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: C:\\Users\\Username/.ssh/id_rsa RSA SHA256:***/pJlFQ/8rmt/***/***
debug1: Server accepts key: C:\\Users\\Username/.ssh/id_rsa RSA SHA256:***/pJlFQ/8rmt/***/***
Enter passphrase for key 'C:\Users\Username/.ssh/id_rsa':
Authenticated to localhost ([::1]:22) using "publickey".
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: ENABLE_VIRTUAL_TERMINAL_INPUT is supported. Reading the VTSequence from console
debug1: ENABLE_VIRTUAL_TERMINAL_PROCESSING is supported. Console supports the ansi parsing
client_loop: send disconnect: Connection reset
PS C:\WINDOWS\system32>
Authentication with username-password key
PS C:\WINDOWS\system32> ssh -v localhost
OpenSSH_for_Windows_8.9p1, LibreSSL 3.4.3
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\Username/.ssh/id_rsa type -1
debug1: identity file C:\\Users\\Username/.ssh/id_rsa-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ecdsa type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ecdsa_sk type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ed25519 type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ed25519-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ed25519_sk type -1
debug1: identity file C:\\Users\\Username/.ssh/id_ed25519_sk-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_xmss type -1
debug1: identity file C:\\Users\\Username/.ssh/id_xmss-cert type -1
debug1: identity file C:\\Users\\Username/.ssh/id_dsa type -1
debug1: identity file C:\\Users\\Username/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_8.9
debug1: compat_banner: match: OpenSSH_for_Windows_8.9 pat OpenSSH* compat 0x04000000
debug1: Authenticating to localhost:22 as 'domain-name\\Username'
debug1: load_hostkeys: fopen C:\\Users\\Username/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
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
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:kjDjwV5y3wmvwwUFwcBVDgAWHfHQxShW/9SJT/tRtzo
debug1: load_hostkeys: fopen C:\\Users\\Username/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen __PROGRAMDATA__\\ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'localhost' is known and matches the ED25519 host key.
debug1: Found key in C:\\Users\\Username/.ssh/known_hosts:3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: get_agent_identities: ssh_fetch_identitylist: agent contains no identities
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_rsa
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_ecdsa
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_ecdsa_sk
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_ed25519
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_ed25519_sk
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_xmss
debug1: Will attempt key: C:\\Users\\Username/.ssh/id_dsa
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: kex_input_ext_info: publickey-hostbound@openssh.com=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Users\\Username/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\Username/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\Username/.ssh/id_ecdsa_sk
debug1: Trying private key: C:\\Users\\Username/.ssh/id_ed25519
debug1: Trying private key: C:\\Users\\Username/.ssh/id_ed25519_sk
debug1: Trying private key: C:\\Users\\Username/.ssh/id_xmss
debug1: Trying private key: C:\\Users\\Username/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
domain-name\Username@localhost's password:
Authenticated to localhost ([::1]:22) using "password".
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: ENABLE_VIRTUAL_TERMINAL_INPUT is supported. Reading the VTSequence from console
debug1: ENABLE_VIRTUAL_TERMINAL_PROCESSING is supported. Console supports the ansi parsing
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: client_input_hostkeys: searching C:\\Users\\Username/.ssh/known_hosts for localhost / (none)
debug1: client_input_hostkeys: searching C:\\Users\\Username/.ssh/known_hosts2 for localhost / (none)
debug1: client_input_hostkeys: hostkeys file C:\\Users\\Username/.ssh/known_hosts2 does not exist
debug1: client_input_hostkeys: host key found matching a different name/address, skipping UserKnownHostsFile update
Microsoft Windows [Version 10.0.19043.1706]
(c) Microsoft Corporation. All rights reserved.
domain-name\Username@ASGL-WL-18025 C:\Users\Username>
"OpenSSH for Windows" version
8.9.1.0
Server OperatingSystem
Windows 10 Pro
Client OperatingSystem
Windows 10 Pro
What is failing
Fail to connect openssh server - client_loop: send disconnect: Connection reset
Expected output
Connection should be successful.
Actual output
client_loop: send disconnect: Connection reset
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ssh -v localhost logs and compare the public-key and password authentication paths, focusing on the session immediately after Authenticated to localhost. Done means reproducing the public-key connection and determining why it ends with client_loop: send disconnect: Connection reset while password authentication opens a shell.
Written by the indexing model from the issue text.
Assessment
- Domain
- authentication, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100