I have two linux machines, let's call them A and B, and an XP in my lan. When I ssh (using putty) from the XP box to A, it stays connected forever, regardless of whether the session is idle (no terminal I/O) or not.
When I connect to A from putty outside the lan (i.e. from another city via the internet), the session disconnects after some period of time if the session is idle. If it is not idle (e.g. I do a tail -f /var/log/maillog) it stays up.
OK, here's the problem: when I ssh from A to B my session on A times out at right around 1 hour, whether or not the session is idle. So, for example if I ssh to B from A and do a tail -f /var/log/maillog (which *is* what I am doing), the session terminates after 1 hour from login even if the tail is generating output.
How do I stop the session from terminating until I expliclity log off?
If there is no traffic on the connection, firewall throws the onnection off it guts. Next packets (belonging to the connection) will be dropped.
Now, ssh supports something like TCPKeepAlive. But You must set it to true on both server and the client(otherwise server would reject TCPKeepAlive packets, and the client would stop sending them).