2

when I connect using /usr/bin/ssh to VPS machines (centos 7), after some little time my keyboard is not working on terminal, when not using ssh I can use terminal normally.

My ubuntu version :

NAME="Ubuntu"
VERSION="19.10 (Eoan Ermine)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.10"
VERSION_ID="19.10"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=eoan
UBUNTU_CODENAME=eoan

uname -a

Linux xxxx 5.3.0-42-generic #34-Ubuntu SMP Fri Feb 28 05:49:40 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I tried this :

sudo apt-get install xserver-xorg-input-all

and not solved the problem. It does not look like sticky keys problem either

I am open to any suggestion to look, it is so annoying that I can not use ssh properly because it is mostly my job is it in.

Sahin
  • 23
  • outside shh keyboard is fine on terminal and I am opening new ssh on a new tab, it was working fine before, maybe some ubuntu update corrupted I do not know. – Sahin Mar 26 '20 at 07:38
  • Yes, setting ServerAliveInterval or using that as a command-line option usually works well and if it doesn't, use a lower value till it does. – mchid Mar 26 '20 at 08:02
  • @pLumo I see. My local network uses wifi too so this may be different. – mchid Mar 26 '20 at 08:07
  • @pLumo was spot on I think, probably I never waited for Broken pipe error to show up and always open up a new tab, ServerAliveInterval 120 solve my problem, I mean ssh still working on the same terminal after changed that, thanks for a quick answer with that little info – Sahin Mar 26 '20 at 08:12
  • Glad to hear. I wrote an answer and removed the comments :-) – pLumo Mar 26 '20 at 08:31

1 Answers1

2

The connection to the server gets lost, but your ssh client does not know about it yet, sending keyboard input and waiting for a response.

That happens because some SSH servers will kick idle clients after a period of time (usually 120 seconds). You need to tell your client to send some packages to the server from time to time to show that you're not idle.

Try setting ServerAliveInterval 120 in .ssh/config file or add as a command line option to ssh: -o ServerAliveInterval=120.

See: How to prevent "Write Failed: broken pipe" on SSH connection?

pLumo
  • 26,947