Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm ssh-ing to a server several thousands kilometers away, and every keystroke takes 500-800ms, so it is getting annoying.

Is it possible to have my ssh client cache each line I type locally and only send to the other server when I press return?

share|improve this question
This would be job of your terminal emulator ( or something), not the SSH client. Unfortunately, all I can find about local line editing is an option in Windows' PuTTY. For now, try printf '\e[12l'; stty -echo to enable local echo (and printf '\e[12h'; stty echo to disable it). This will still send each keypress separately, but will echo them locally, resulting in instant updates and epic confusion (really). – grawity Mar 14 '11 at 21:56
FWIW, check your Internet connection. I SSH to machines which are ~1700 km, ~7000 km, ~8000 km away, with less than 200 ms RTT – even though my connection is barely above dialup. (Admittedly, I did my tests without BitTorrent running.) – grawity Mar 14 '11 at 22:04
grawity: I just checked the distance, it is ~15200 km. Can I still achieve latency < 200ms? – Eric Mar 15 '11 at 4:06

See the Compression (-C) option in man 1 ssh. It may help on your circumstance.

A better question would be "What's the round-trip latency of my connection?," which you can determine by looking at the round-trip time (RTT) via ping. Take a close look at the -s, -M, and -U options (see man 8 ping) to enable you to adjust your packets to see if the problem is dropped packets, or some other aspect of your network connection.

Distance can certainly play a factor on certain types of networks (DSL or satellite, for example) but has much more to do with network type, network congestion, and other factors that you haven't mentioned in your post.

Lastly, don't discount server or host issues. Try testing your connection against various servers to see if you have a problem that's limited to a single host, or if your issue is more generic.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .