'SSH kex_exchange_identification: read: Connection reset by peer
Hello today i am trying to connect to a ssh host but im facing some problems, i already generated a rsa public key and tried to connect to the host but this error keeps appearing :
kex_exchange_identification: read: Connection reset by peer
I already did connect once to the host but once i restarded my machine the same problem appeared.
Sometimes when i move to the next phase where i should input the password this appears: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
This is the debugger output:
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolving "appserver.alunos.di.fc.ul.pt" port 22
debug2: ssh_connect_direct
debug1: Connecting to appserver.alunos.di.fc.ul.pt [194.117.22.70] port 22.
debug1: Connection established.
debug1: identity file /home/bruno/.ssh/id_rsa type 0
debug1: identity file /home/bruno/.ssh/id_rsa-cert type -1
debug1: identity file /home/bruno/.ssh/id_dsa type -1
debug1: identity file /home/bruno/.ssh/id_dsa-cert type -1
debug1: identity file /home/bruno/.ssh/id_ecdsa type -1
debug1: identity file /home/bruno/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/bruno/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/bruno/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/bruno/.ssh/id_ed25519 type -1
debug1: identity file /home/bruno/.ssh/id_ed25519-cert type -1
debug1: identity file /home/bruno/.ssh/id_ed25519_sk type -1
debug1: identity file /home/bruno/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/bruno/.ssh/id_xmss type -1
debug1: identity file /home/bruno/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.4
kex_exchange_identification: read: Connection reset by peer
And in the next phase this is the debugger output
OpenSSH_8.2p1 Ubuntu-4ubuntu0.4, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolving "appserver.alunos.di.fc.ul.pt" port 22
debug2: ssh_connect_direct
debug1: Connecting to appserver.alunos.di.fc.ul.pt [194.117.22.70] port 22.
debug1: Connection established.
debug1: identity file /home/bruno/.ssh/id_rsa type 0
debug1: identity file /home/bruno/.ssh/id_rsa-cert type -1
debug1: identity file /home/bruno/.ssh/id_dsa type -1
debug1: identity file /home/bruno/.ssh/id_dsa-cert type -1
debug1: identity file /home/bruno/.ssh/id_ecdsa type -1
debug1: identity file /home/bruno/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/bruno/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/bruno/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/bruno/.ssh/id_ed25519 type -1
debug1: identity file /home/bruno/.ssh/id_ed25519-cert type -1
debug1: identity file /home/bruno/.ssh/id_ed25519_sk type -1
debug1: identity file /home/bruno/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/bruno/.ssh/id_xmss type -1
debug1: identity file /home/bruno/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000002
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to appserver.alunos.di.fc.ul.pt:22 as 'psi028'
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,[email protected],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,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],ssh-ed25519,[email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-rsa,ssh-dss
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,arcfour
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,arcfour
debug2: MACs ctos: hmac-sha1,hmac-ripemd160
debug2: MACs stoc: hmac-sha1,hmac-ripemd160
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: none
debug3: send packet: type 34
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<7680<8192) sent
debug3: receive packet: type 31
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug2: bits set: 4068/8192
debug3: send packet: type 32
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug3: receive packet: type 33
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:wUjrYSdnZfF4ABGfaHJ6AlVfaG8xX/4vvaGEiByZ9ng
The authenticity of host 'appserver.alunos.di.fc.ul.pt (194.117.22.70)' can't be established.
RSA key fingerprint is SHA256:wUjrYSdnZfF4ABGfaHJ6AlVfaG8xX/4vvaGEiByZ9ng.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'appserver.alunos.di.fc.ul.pt,194.117.22.70' (RSA) to the list of known hosts.
debug2: bits set: 4060/8192
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 4294967296 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 4294967296 blocks
debug1: Will attempt key: /home/bruno/.ssh/id_rsa RSA SHA256:6rTqqVfQAWsIDRp0CTHP0lQsZFDYB7d7G/wldGg8ZZQ
debug1: Will attempt key: /home/bruno/.ssh/id_dsa
debug1: Will attempt key: /home/bruno/.ssh/id_ecdsa
debug1: Will attempt key: /home/bruno/.ssh/id_ecdsa_sk
debug1: Will attempt key: /home/bruno/.ssh/id_ed25519
debug1: Will attempt key: /home/bruno/.ssh/id_ed25519_sk
debug1: Will attempt key: /home/bruno/.ssh/id_xmss
debug2: pubkey_prepare: done
debug3: send packet: type 5
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,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
debug2: we did not send a packet, disable method
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/bruno/.ssh/id_rsa RSA SHA256:6rTqqVfQAWsIDRp0CTHP0lQsZFDYB7d7G/wldGg8ZZQ
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/bruno/.ssh/id_dsa
debug3: no such identity: /home/bruno/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/bruno/.ssh/id_ecdsa
debug3: no such identity: /home/bruno/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/bruno/.ssh/id_ecdsa_sk
debug3: no such identity: /home/bruno/.ssh/id_ecdsa_sk: No such file or directory
debug1: Trying private key: /home/bruno/.ssh/id_ed25519
debug3: no such identity: /home/bruno/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /home/bruno/.ssh/id_ed25519_sk
debug3: no such identity: /home/bruno/.ssh/id_ed25519_sk: No such file or directory
debug1: Trying private key: /home/bruno/.ssh/id_xmss
debug3: no such identity: /home/bruno/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
[email protected]'s password:
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
[email protected]'s password:
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
[email protected]'s password:
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
What am i missing here, could it be from my configuration?
Command use to generate keys: ssh-keygen -o -t rsa -C "[email protected]"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
