Why isn't it possible to lower TCP values of running SSH session?

john smith wempwer at gmail.com
Tue Nov 24 09:25:15 AEDT 2015


I am running OpenSSH_6.7p1 on Slackware 14.1 x64.  I haven't modified
a stock config.  On Linux TCP timeouts are controlled by these 3
files:

$ cat /proc/sys/net/ipv4/tcp_keepalive_time \
>  /proc/sys/net/ipv4/tcp_keepalive_intvl \
> /proc/sys/net/ipv4/tcp_keepalive_probes
7200
75
9

These are their default values. I modified them to 3, 1, 1
respecitively before establishing a new SSH connection. After
establishing an SSH connection to a machine next to me I unplugged a
network cable on the remote machine and had to wait for 3 seconds for
the SSH session to be terminated by Linux. This is what I
expected. Next, I connected again and while SSH session was already
opened I changed values to their defaults - 7200, 75, 9. After
unplugging a network cable I wasn't disconnected within 3 seconds. It
made me think that it's possible to modify TCP timeouts of opened TCP
sockets such as SSH connections.  However, after connecting to the same
machine again I changed timeout values to 3, 1, 1 again. To my
surpires, after unplugging a network cable on the remote side I wasn't
disconnected within 3 seconds. It seems it's only possible to increase
TCP timeout values when SSH session is already opened but not to lower
them. Why? Is it Linux or OpenSSH thing?

-- 
<wempwer at gmail.com>


More information about the openssh-unix-dev mailing list