You are not logged in.

#1 2018-02-25 03:37:26

stillrottentothegore
Member
Registered: 2017-07-18
Posts: 19

openssh giving "connection reset by peer."

Hey friends,

Having a bit of trouble with ssh currently. I'm trying to set up my ssh server, and after starting/restarting either sshd.service or sshd.socket, and using commands "ssh localhost", "ssh username@host", "ssh username@127.0.0.1", or "ssh username@my.local.ip.address", it comes up with "ssh_exchange_identification read: Connection reset by peer."

I've tried uninstalling and reinstalling the openssh package. I have port 22 open in ufw and IPtables, and there's no firewall behind on the router side currently. I've also changed the location of my authorized_keys file to /etc/ssh/username and changed sshd_config to point to it (as my /home is encrypted). I took a look through the wiki page for Secure Shell and couldn't seem to find anything out of the ordinary. Pretty stumped, not sure where to go next.

Let me know if you need any output, the help is much appreciated.

Offline

#2 2018-02-25 04:03:57

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: openssh giving "connection reset by peer."

So you are trying to ssh to the server from the same server?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-02-25 04:19:41

stillrottentothegore
Member
Registered: 2017-07-18
Posts: 19

Re: openssh giving "connection reset by peer."

jasonwryan wrote:

So you are trying to ssh to the server from the same server?

That's correct, just wanted to get it up and running before I started testing it with other computers on my network.

Offline

#4 2018-02-25 06:50:07

chowbok
Member
Registered: 2017-11-27
Posts: 20

Re: openssh giving "connection reset by peer."

The problem is that "connection reset by peer" is a pretty generic error message. Just means that you got disconnected. What does the journal say? What do you get when you try "ssh -vv localhost"?

Offline

#5 2018-02-25 07:39:12

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,229
Website

Re: openssh giving "connection reset by peer."

Try running sshd in foreground debug mode too:  /usr/sbin/sshd -Dd  (Don't forget to stop the systemd daemon first)

Offline

#6 2018-02-25 09:00:02

stillrottentothegore
Member
Registered: 2017-07-18
Posts: 19

Re: openssh giving "connection reset by peer."

chowbok wrote:

The problem is that "connection reset by peer" is a pretty generic error message. Just means that you got disconnected. What does the journal say? What do you get when you try "ssh -vv localhost"?

OpenSSH_7.6p1, OpenSSL 1.1.0g  2 Nov 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "localhost" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/stillrotten/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/stillrotten/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/stillrotten/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/stillrotten/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/stillrotten/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/stillrotten/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/stillrotten/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/stillrotten/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
ssh_exchange_identification: read: Connection reset by peer

Journal.

fukawi2 wrote:

Try running sshd in foreground debug mode too:  /usr/sbin/sshd -Dd  (Don't forget to stop the systemd daemon first)

Here's the output I got from that:

/etc/ssh/sshd_config line 120: Deprecated option RSAAuthentication
debug1: sshd version OpenSSH_7.6, OpenSSL 1.1.0g  2 Nov 2017
key_load_private: memory allocation failed

EDIT: Ignore this last piece, just realized I didn't sudo that, I'll go it again tomorrow.

EDIT 2: Updated.

Last edited by stillrottentothegore (2018-02-25 20:16:33)

Offline

#7 2018-02-25 22:12:35

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,229
Website

Re: openssh giving "connection reset by peer."

That's the entire debug output from sshd during your connection attempt...?

Offline

#8 2018-02-25 22:18:22

stillrottentothegore
Member
Registered: 2017-07-18
Posts: 19

Re: openssh giving "connection reset by peer."

fukawi2 wrote:

That's the entire debug output from sshd during your connection attempt...?

Yeah, trust me I wish there was more to work with.

Offline

Board footer

Powered by FluxBB