SSH rapid keypresses cause disconnect

1

I often work directly on a server in vim via ssh for small changes to sites, etc. However often if I input a lot of keypresses rapidly (such as holding down a page dn, scrolling my mouse wheel or pasting directly into the terminal from the local OS) the session will disconnect.

I'm not sure if this is down to the ssh binary, my terminal program or even the remote server, and was just wondering if there was any insight as to why this happens (and possible workarounds).

I alleviate most of the frustration by using a Screen session on the remote server, but it still is a pain to have to re-login every time I forget. For example is there a keypress buffer or something that I can enable which might solve this.

Set-up -

  • Local OS: Windows 7 x64
  • Remote OS: Fedora 13
  • Platform: Cygwin (Latest)
  • Terminal: MinTTY (Latest Cygwin bundled release)

9point6

Posted 2012-04-30T11:49:58.213

Reputation: 387

Does it happen immediately or does it time out? Does it happen if you use scp? does it occur just for the one server? the one client? – Michael Slade – 2012-04-30T12:04:55.210

Yeah, if I'm pasting into the terminal for example, some of the content will show up then the terminal will stall and after about 30s I'll get "Write Failed: Connection reset by peer"

It mostly happens on a single server, but has happened in the past on other servers, I think it comes down to a char buffer somewhere becoming overloaded since the connection to the server is a bit flaky at times. I've used scp, I'll try that and update, but I've used SFTP fine before. I've not tried other clients in a while so I can't say if it happens in other situations. I'll install PuTTY and report back. – 9point6 – 2012-04-30T12:11:07.500

does it happen with any other protocols? say if you post a file to a web server? – Michael Slade – 2012-04-30T12:12:33.330

Nope it's just SSH via terminal afaik. I'd test another terminal protocol, but SSH is the only one available to me at the moment. – 9point6 – 2012-04-30T12:40:38.413

If you can scp large files at many kilobytes (or megabytes) per second to/from that server, then the problem isn't in the SSH protocol or the SSH server software, because scp uses the same protocol as ssh. The error "Connection reset by peer" means the server's TCP/IP stack sent a RST packet not that the SSH server closed the connection, so the server's stack was unable to hold open the connection for some reason. – Fran – 2012-05-07T14:06:44.220

Answers

1

I've tried pasting a load of stuff (10k lines) to two RedHat servers we have (one low latency one medium) using Putty and MinTTY but have not been able to replicate the problem.

I think trying putty would be the easiest and most likely to work.

matt

Posted 2012-04-30T11:49:58.213

Reputation: 135

PuTTY is likely the best answer. I've never had a problem with it. (Other than the usual.. "Ack! I'm on Windows!" issues...) – lornix – 2012-06-30T06:51:55.810