On 24.04.24 17:10, Guilhem Moulin wrote:
On Wed, 24 Apr 2024 at 16:32:09 +0200, Lee Garrett wrote:
Although the dropbear man page is not explicit, I'm assuming it refers to
TCP keepalive.
I think this assumption is incorrect:
https://sources.debian.org/src/dropbear/2024.84-1/src/common-session.c/#L497
It should be trivially reproducible by running `ssh -o ServerAliveCountMax=3
-o ServerAliveInterval=1 root@yourdropbearserver`. The client should then
disconnect after 3 seconds.
Seems to work as expected for me:
$ ssh -oLogLevel=DEBUG3 \
-oServerAliveCountMax=3 -oServerAliveInterval=1 \
-oUserKnownHostsFile=/tmp/known_hosts \
-i /tmp/test.key \
-l user -p 10022 127.0.0.1 sleep 300
[…]
debug1: Sending command: sleep 300
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug3: client_repledge: enter
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 65536 rmax 32759
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
debug3: send packet: type 80
debug3: receive packet: type 82
debug3: send packet: type 80
debug3: receive packet: type 82
debug3: send packet: type 80
debug3: receive packet: type 82
debug3: send packet: type 80
debug3: receive packet: type 82
[…]
debug3: send packet: type 80
debug3: receive packet: type 82
debug3: receive packet: type 96
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: chan_shutdown_write: channel 0: (i0 o1 sock -1 wfd 5 efd 6
[write])
debug2: channel 0: output drain -> closed
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug2: chan_shutdown_read: channel 0: (i0 o3 sock -1 wfd 4 efd 6
[write])
debug2: channel 0: input open -> closed
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t4 [session] r0 i3/0 o3/0 e[write]/0 fd -1/-1/6
sock -1 cc -1 io 0x00/0x00)
debug3: send packet: type 1
Transferred: sent 15360, received 7448 bytes, in 300.0 seconds
Bytes per second: sent 51.2, received 24.8
debug1: Exit status 0
There is one packet 80/82 exchange per second until the `sleep 300`
terminates. The output is similar with OpenSSH's sshd.
Thanks for debugging this. Then I'll have to try and reproduce this on my remote
server when I find time. Unfortuntely it might take a few days as I need the
services on it for now. Thanks again for the swift response!