I do a lot of work on a centos (7.2) machine into which i ssh from an ubuntu (14.04) machine.

Everything works fine, almost. But after a while on the remote, usually a couple of minutes, I have to wait for the next prompt (e.g., after just pressing enter) for a couple of seconds. This is really annoying.

Logging out and back in fixes this temporarily, but it happens again after a couple of minutes. I'm not talking about the password prompt upon login or so, that part's fine. It's the regular prompt after being logged in for a while that becomes slow.

Any idea where to look for a solution?


it also happens logging in from other boxes, but seems to be specific to my user account.

ssh -v shows no additional output when the shell hangs (so after login there's nothing new until logout). here's the last couple of lines from ssh -v:

debug1: Authentication succeeded (password).
Authenticated to X.X.X.X ([X.X.X.X]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 2 clearing O_NONBLOCK
Connection to X.X.X.X closed.
Transferred: sent 11888, received 26136 bytes, in 329.2 seconds
Bytes per second: sent 36.1, received 79.4
debug1: Exit status 0

htop shows "-bash" to use 100%cpu while i'm waiting for the new prompt.

  • it might be useful to out put ssh -v the next time you connect – j0h Jan 7 '16 at 13:55

It's hard to tell what may cause this but in my opinion it looks like a normal connection delay, this can be tweaked by modifying the way you connect to centos.

  • Edit your /etc/ssh/sshd_config : Compression yes to use compression, and service ssh restart on server side to disable dns lookup.
  • Force IPV4 or IPV6 ssh -4 user@host or ssh -6 user@host

(Also changing the authentication method can help)

  • thanks for the pointers. i don't think it's a server-side issue, though. it only happens when i login from this particular machine, not from somewhere else. (i'll edit the question accordingly) – tikacp Jan 6 '16 at 17:31
  • by now it also happens form other machines, but apparently only for my user account. compression does not change anything, neither does ipv4. also, i'm pretty sure this is not normal. – tikacp Jan 11 '16 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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