Logically, there are at least two players: sshd and systemd. What sshd does when (TCP) connection appears dead, and how systemd cleans out “closing” sessions. The latter with assumption that sshd does tell systemd that session is over.
client_loop: send disconnect: Connection reset
is displayed pc terminal.
also Rocky and CentOS is same value
sshd -T | grep -E “alive|time”
logingracetime 120
clientaliveinterval 180
clientalivecountmax 3
tcpkeepalive yes
Cent os
ssh -v 0
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
Rocky
ssh -v 0
OpenSSH_8.7p1, OpenSSL 3.0.7 1 Nov 2022
adding infomation
node a (relay) scripts cmd doing . ( logging operation)
node b (end) less command waiting file update
Wifi disconnected and met windows terminal get messages “client_loop: send disconnect: Connection reset”
wait five min re-connect wifi
we can reproduce this.
man script of util-linux-2.23.2-65.el7_9.1.x86_64 writes:
BUGS
Script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects.
man script of util-linux-2.37.4-15.el9.x86_64 writes:
BUGS
script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects.
script is primarily designed for interactive terminal sessions. When stdin is not a terminal (for example: echo foo | script ), then the session can hang, because the interactive shell within the script session misses EOF and script has no clue when to close the session. See the NOTES section for more information.
The “has no clue when to close the session” sounds like what you get.
The URL in rpm -qi util-linux points to Wikipedia, doesn’t it? script (Unix) - Wikipedia
and the man script says:
On CentOS 7 machine I do see that it has had util-linux based on upstream 2.32.2 at least from 2016 onwards.
On CentOS 8/AlmaLinux 8 the util-linux has been based on 2.32.1 all the time.
On AlmaLinux 9 the util-lnux seems to be based on 2.37.4.
While AlmaLinux is no longer as close to RHEL as Rocky is, I bet that RHEL 9 – and thus Rocky 9 – will stay at util-linux-2.37.4-x for quite while. Perhaps even to EOL at 2032. It is possible though that Red Hat backports some bug fixes to the util-linux-2.37.4-x.el9.