Question
SSH error: Connection closed by host port 22
I got this error when trying to connect to the server using ssh
$ ssh -vvv user@ip
OpenSSH7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /etc/ssh/sshconfig
debug1: /etc/ssh/sshconfig line 20: Applying options for *
debug2: resolving “128.199.240.57” port 22
debug2: sshconnectdirect: needpriv 0
debug1: Connecting to 128.199.240.57 [128.199.240.57] port 22.
debug1: Connection established.
debug1: identity file /Users/{myusername]/.ssh/idrsa type 1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users//{myusername]/.ssh/idrsa-cert type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users//{myusername]/.ssh/iddsa type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users//{myusername]/.ssh/iddsa-cert type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users//{myusername]/.ssh/idecdsa type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users//{myusername]/.ssh/idecdsa-cert type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users//{myusername]/.ssh/ided25519 type -1
debug1: keyloadpublic: No such file or directory
debug1: identity file /Users//{myusername]/.ssh/ided25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH7.2p2 Ubuntu-4ubuntu2.2
debug1: match: OpenSSH7.2p2 Ubuntu-4ubuntu2.2 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting ONONBLOCK
debug1: Authenticating to 128.199.240.57:22 as ’/{myusername]’
debug3: hostkeysforeach: reading file “/Users//{myusername]/.ssh/knownhosts”
debug3: recordhostkey: found key type ECDSA in file /Users//{myusername]/.ssh/knownhosts:4
debug3: loadhostkeys: loaded 1 keys from 128.199.240.57
debug3: orderhostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2MSG_KEXINIT sent
Connection closed by 128.199.240.57 port 22
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×