Active2 years, 6 months ago
  1. Connection Reset By Peer Ssh
  2. Connection Reset By Peer Ssh
  3. Ssh Connection Reset By Port 22

I can SSH in one direction with no problems:

OK:

Connection

but the other way:

I get Read from socket failed: Connection reset by peer.

If you are prompted for a password then there was a problem with your ssh key. If you are still seeing the 'ssh_exchange_identification: read: Connection reset by peer' response, then you should be able to identify what the problem is from the log entry in the '/var/log/auth.log' file after. How to properly setup squid3 as HTTPS proxy? I keep getting a 'Connection timed out error' whenever I hit an HTTPS protocol web. Here is my /etc/squid3/squid.

I don't even begin to know where to look to solve this.

Anyone have any clues?

SSH - Connection reset by peer - Linux Host. Connection reset by peer. After lot of struggle, I fixed the ssh connection refused by simply running the following command. EC2 Amazon web server not answering by ssh connection. (Connection reset by peer) Hot Network Questions. I'm currently getting the error, socket.error: [Errno 54] Connection reset by peer when I use requests.get(url, params=kwargs) and the params contain large bodies of.

boehjboehj
1,5802 gold badges16 silver badges22 bronze badges

6 Answers

  1. start monitoring the server's log file

    tail -f /var/log/auth.log

  2. add -v to get a verbose output at the client end

    ssh user@computerB -v

This might give you more details about the cause. if the rsa and dsa keys are missing on the server, fix them by:

Eric Carvalho
43.8k17 gold badges120 silver badges150 bronze badges
änthräXänthräX

I re-installed the SSH bits by doing:

This fixed all my problems.

Kevin Bowen
15.7k15 gold badges62 silver badges73 bronze badges
boehjboehj
1,5802 gold badges16 silver badges22 bronze badges

änthräX's method is very helpful. It works for me!

Basically I think, after installed ssh, key files are needed.

The only revision I made was to use rsa instead of rsa1:

That modified method worked for me.

Community
Alan_04Alan_04

It's because somehow the permissions of the files inside /etc/ssh have changed..So change the permission of the files like the example given below:

use:

and so on..

Finally the file permissions should look like something like given below,

Ssh

After changing the permissions try connecting from putty, should work fine.

Radu Rădeanu
126k36 gold badges265 silver badges333 bronze badges
Varun JosephVarun Joseph

We had a similar problem, but it occurred only when logging from Ubuntu to Solaris. Making sure all these lines are present in /etc/ssh/ssh_config on the Ubuntu host fixed the problem (you should find some of these lines are already present):

In the case of Xubuntu I needed only the last two.

Connection Reset By Peer Ssh

Philip KearnsPhilip Kearns

This message can also stem from multiple attempted ssh attacks. If you're seeing this message in your logs, a malicious source may be attempting to ssh into your machine by using brute-force password attempts.

To slow down the attempts, install the package 'fail2ban':

From fail2ban's wiki page:

Fail2ban scans log files (e.g. /var/log/apache/error_log) and bans IPs that show the malicious signs -- too many password failures, seeking for exploits, etc. Generally Fail2Ban is then used to update firewall rules to reject the IP addresses for a specified amount of time

LiloulinxLiloulinx

protected by CommunityFeb 27 '17 at 11:47

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged ssh or ask your own question.

Active2 years, 7 months ago

I am having some trouble with SSH on my linux server running CentOS. I can connect to my server fine using PuTTY or ssh from windows cmd. The same goes for using secure FTP. I can connect to the server, get a list of files and everything is okay. The problem occurs when I try to send any quantity of data across the network.

Whenever I attempt to transfer anything beyond a certain threshold, the connection fails and I see a 'Connection reset by peer' message. I have a sql file that is about 3 MB in my home directory. If I attempt to FTP it, it will begin the transfer and die after about 48k has been transferred. Then it will initiate a new connection and transfer another 48k. If I use PuTTY and open a session I can connect and login fine. If i attempt to cat file.sql again, the connection is terminated and I get a 'Connection reset by peer' message. Going from my local workstation to the server it's the same situation. I have quite a bit of source code that I need to commit to my svn repository hosted on the server, but the same 'Connection reset by peer' message appears.

Matlab 2008a download. You can create, run, and share symbolic math code using the MATLAB ® Live Editor.

I know the problem is on my local workstation because I can use my wife's macbook and ssh to the server with no problems. I can ssh into a friend's linux box (using the same putty install) and sftp to my server from their and download the file, open another ssh session from his box to my server and cat the file. So, something is going on, but i'm not sure what. Does anyone have any ideas?

Update

I have been trying to figure this out some more, and it seems like there is a hard limit of the amount of data that I can transfer in a single ssh session. I hit it immediately if I do cat file.sql but I can also keep typing ls -l a consistent number of times and will also get the 'Connection reset by peer' message. I've tried:

  • generating new ssh keys
  • restarting my router
  • restarting my computer
  • restarting the remote server

I wrote out a tcpdump on the remote server, but I don't understand TCP at such a detailed level that it makes much sense to me. I turned on debugging in ssh and here is the portion of the log leading up to the connection being reset:

UPDATE 2:

About a week ago, I modified my ssh settings on my server using this wiki post: http://wiki.centos.org/HowTos/Network/SecuringSSH

Because I occasionally need to access my server from work, and because port 21 is open on our firewall, I changed the ssh port to 21. To further diagnose this problem, I tried to revert my ssh settings and changed the ssh port back to 22. Low and behold, the I do not encounter the error when I use port 22. Change it back to 21, and like clockwork when I hit 48k of data transferred - Connection reset by peer.

Given that I can get the initial connection and that I've had no trouble in the past establishing ftp connections on port 21, it doesn't seem like my firewall configuration is the issue.

At least at this point, I've got the problem narrowed down to the ssh port on my server. Flip it to 21 and instant problems, change it back to 22, no problem at all..

Can anyone think of why the listen port would make a difference? Again, it's only on my Windows XP box that it's causing problems. Let me know if anyone has any thoughts on what might cause this.

Update 2:

Just narrowed the problem down and I stand corrected - it is a firewall issue, but a Windows firewall issue, not at my router. If I use port 21 and disable the windows firewall I do not encounter the 'Connection reset by peer' message. To answer the obvious question, yes, port 21 is open on the windows firewall.

Since this computer is behind the firewall on my router, I can just disable it for now, but I would be interested to figure out what's going on here.

proflux
profluxproflux

2 Answers

You can solve using command line with this command (type this as administrator):

Connection Reset By Peer Ssh

netsh advfirewall set global statefulftp disable

Alessandro SperindéAlessandro Sperindé

This could be related to your router trying to handle FTP NAT connection tracking automatically. It would only happen on port 21, not 22. Check out http://www.faqs.org/docs/iptables/complexprotocols.html

Ricardo PardiniRicardo Pardini

Ssh Connection Reset By Port 22

Not the answer you're looking for? Browse other questions tagged sshcentosputty or ask your own question.

Coments are closed
© 2020 - d1lyi.netlify.com
Scroll to top