1

I work daily on SSH from a Linux desktop to an AWS EC2 Amazon Linux server and the connection has performed very reliably for two years, but in the last few days I have seen the SSH command line hang after the first keyboard character is typed, only when uploading at full bore.

By "hang" I mean that it has to be aborted with ~. rather than a long wait for a response. There is probably a more detailed cause, but I am only seeing it lock up after typing that very first character, which has been echoed back from the server after the usual latency (i.e., it's not just echoing back that character in the SSH client).

This only happens during periods of heavy (full bandwidth) uploads from the same machine. (I haven't tested it yet with the network bandwidth being used from another machine on our network.) During these conditions, the problem appears to happen at random, and always goes away when the upload bandwidth becomes more available again.

Entering a carriage return never causes the hanging... for instance, entering several blank lines in short succession and then quickly trying to enter "ls" would hang after typing the L. And it's only after the first character that it locks up.

Desktop: Ubuntu 14.04 with OpenSSH_6.6.1p1 (Ubuntu-2ubuntu2.3, OpenSSL 1.0.1f 6 Jan 2014). Server: also running OpenSSH_6.6.1p1 (version 1.0.1k-fips).

Current option settings, which had always worked for me, even during prolonged periods of intensive upload bandwidth use, until very recently:

server:/etc/ssh/sshd_config

ClientAliveInterval 15
ClientAliveCountMax 240
TCPKeepAlive no

client:~/.ssh/config

ServerAliveInterval 15
ServerAliveCountMax 240
TCPKeepAlive no

The next step might be to raise or lower the 15-second interval, but I'm not sure which makes more sense in this case. Note I have turned off TCPKeepAlive because having this option active on either the client on the server caused connections to be dropped about every 5 minutes. I believe this is because TCP ACK packets are not allowed into the AWS subnets (How does tcp-keepalive work in ssh?)

Whether readers are on AWS or not, I look forward to any option settings or changes that have fixed it. This is a very infrequent problem but I think it does mean that my SSH settings above should be made more robust, and the answer may be very helpful to AWS users in general.

3
  • I also need to know why this was classified as an Ubuntu question, as per the page title. It doesn't help at all that the threads here tend to be classified according to the most popular tag. This is an SSH problem first and Ubuntu is only of secondary importance. This time I even submitted the question with only the SSH tag, adding the other two tags later, but that hasn't made a difference in this case. Do I really need to leave off the other tags in order to be sure a question page is titled properly?
    – rphair
    Nov 20, 2015 at 14:33
  • When you create the question you choose the appropriate tags for it. But it suggest some.
    – Gopoi
    Nov 20, 2015 at 15:14
  • That was a good suggestion to change the tag from ubuntu to linux-networking. Of course, now Stack Overflow determines the title from the next most popular tag amazon-web-services which may not even be the problem. For my own knowledge at least I know it is simply choosing the most popular tag for the <title>. But another vote suggests that the title keyword doesn't make this question "more difficult to find" which is good enough for me.
    – rphair
    Nov 20, 2015 at 19:35

0

You must log in to answer this question.

Browse other questions tagged .