LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-17-2021, 09:50 PM   #1
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Rep: Reputation: 18
ssh connection reset by peer


hi-

I read all the tutorials and did everything. I still get this crazy error I can't solve.

kex_exchange_identification: read: Connection reset by peer
Connection reset by 127.0.0.1 port 3184

I am using NAT with virtualbox with port forwarding and ssh.

I tried to go into /var/log/secure in fedora and read. I can't make much sense of it.

My ports are forwarded:

Host IP: 127.0.0.1
Host Port: 3184
Guest IP: 10.x.x.x
Guest Port: 22

I try executing: ssh -p 3184 -vvv -o PreferredAuthentications=password -o PubKeyAuthentication=no username@127.0.0.1

A question you may ask is, why key exchange identification when I changed it to passwords in my sshd_config on the linux guest machine server? It is like, no matter what I do, it marches on with its own agenda.

thanks for any ideas.

robo-loki
 
Old 01-17-2021, 10:44 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,382
Blog Entries: 3

Rep: Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772
kex_exchange_identification means that the client and the server are trying to decide which algorithms to use to encrypt the session. You are probably connecting a very old client to very new server, or vice versa. The solution in that case is to upgrade, from backports if necessary.

Which version is your SSH client, which version is your SSH server?
 
1 members found this post helpful.
Old 01-17-2021, 11:16 PM   #3
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
Hi-

I put the ssh version on cygwin to equal the version on fedora in vbox guest. I still get the errors after checking the version numbers (which match). I verified with ssh -V. I checked version number in cygwin package manager too.

Thanks for helping,
robo-loki
 
Old 01-18-2021, 12:27 AM   #4
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
Hi gals/guys-

I figured it out. I don't like to play with firewalls.

I had checked the windows firewall with a command yesterday, and it said it wasn't blocking anything.

I should have checked my linux firewall.

I entered at command prompt:# ufw allow ssh.

I don't mind too much that I got stuck because I read a lot of useful stuff along the way.

I restricted it by IP to only allow from a private address.

thanks
robo-loki
 
Old 01-18-2021, 02:20 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,382
Blog Entries: 3

Rep: Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772
Glad it is working and thanks for the follow up explaining the cause of the problem. However, if it was the packet filter blocking things the SSH client should not have gotten even as far as key exchange. The client should have comlained about "connection refused". So could you please describe a little more about where the client and server were in relation to each other and to the packet filter?
 
1 members found this post helpful.
Old 01-18-2021, 03:28 AM   #6
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
Hi-

This is a snippet from my console:

I enter the passphrase and I am in.

ssh -p 3184 -v user@127.0.0.1
Enter passphrase for key '/home/user/.ssh/id_rsa':

The client is in cygwin win 10. I run openssh in mintty.

The server is a virtualbox guest machine. I run fedora.

The packet filter is in virtualbox guest machine ufw. I am using NAT.

thanks
 
Old 01-18-2021, 04:21 PM   #7
mtdew3q
Member
 
Registered: Mar 2006
Location: the next town over from siberia
Distribution: xubuntu
Posts: 481

Original Poster
Rep: Reputation: 18
Hi -

I'm on my phone. Will this link help?

https://askubuntu.com/questions/1613...-ip-forwarding


Thanks,
Robo-loki
 
Old 01-19-2021, 01:32 AM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,382
Blog Entries: 3

Rep: Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772
Since the client is Vista10 and the server is a Fedora guest VM in Vista10, and the problem occurs connecting between them it looks like a problem with the host system, which is Vista10. Therefore in that case I would recommend turning to one of the all-to-common Windows-oriented forums.
 
Old 06-15-2021, 10:01 AM   #9
hpfeil
Member
 
Registered: Nov 2010
Location: Tucson, Arizona US
Distribution: Slackware Current
Posts: 357
Blog Entries: 1

Rep: Reputation: Disabled
Hate to necropost, but I just ran into the same kex_exchange_identification issue. Hunted down the problem - /etc/hosts.allow did not have an entry for the client on the sshd: line; hosts.deny has sshd:ALL, so each local LAN client needs to be explicitly allowed.
 
Old 06-15-2021, 10:14 AM   #10
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,382
Blog Entries: 3

Rep: Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772
Quote:
Originally Posted by hpfeil View Post
Hate to necropost, but I just ran into the same kex_exchange_identification issue. Hunted down the problem - /etc/hosts.allow did not have an entry for the client on the sshd: line; hosts.deny has sshd:ALL, so each local LAN client needs to be explicitly allowed.
Support for tcpwrappers was removed from OpenSSH back in version 6.7 back in 2014. That's a while back, so far back that most people are very unlikely to encounter tcpd at all.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH fatal: Read from socket failed: Connection reset by peer humbletech99 Linux - Networking 3 01-03-2007 06:41 PM
SSH/rsync "Connection reset by peer" hamish Linux - Networking 6 12-10-2005 06:09 AM
ssh connection reset by peer Brain Drop Linux - Software 4 07-30-2004 09:18 PM
ssh connection reset by peer bubsgt95 Linux - General 6 06-27-2003 10:24 PM
"Connection Reset By Peer" with SSH YMJ Linux - Networking 10 03-24-2003 06:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration