
WARNING: SSHD uses but does not require TCP keepalive
If you disable tcp-keepalive, ssh will disconnect immediately. Unless you have physical access to your server or a recovery console, you will not be able to re-connect using ssh. SSHD does not need TCP keepalive to keep the connections alive although it is enabled by default.
You can disable TCP keepalive dependency by adding to your SSHD config
Code: Select all
sudo nano /etc/ssh_config
Code: Select all
TCPKeepAlive no
Code: Select all
sudo systemctl reload sshd
How to turn TCP keepalive off completely and permanently in Debian?
Before disabling TCP keepalive you must check carefully if there are any software that requires it.
To disable TCP keepalive you need to add settings to your sysconf configuration file to make the configuration persistent:
Code: Select all
sudo nano /etc/sysctl.conf
Code: Select all
net.ipv4.tcp_keepalive_time=0
net.ipv4.tcp_keepalive_intvl=0
net.ipv4.tcp_keepalive_probes=0
Code: Select all
sudo sysctl -p
Happy hacking,
s