From nobody Wed Mar 01 11:36:32 2023 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PRXJ470Drz3vllZ for ; Wed, 1 Mar 2023 11:36:36 +0000 (UTC) (envelope-from grembo@freebsd.org) Received: from mail.evolve.de (mail.evolve.de [213.239.217.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.evolve.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PRXJ43G59z4V3n; Wed, 1 Mar 2023 11:36:36 +0000 (UTC) (envelope-from grembo@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail.evolve.de (OpenSMTPD) with ESMTP id e109624b; Wed, 1 Mar 2023 11:36:33 +0000 (UTC) Received: by mail.evolve.de (OpenSMTPD) with ESMTPSA id e1a5530c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 1 Mar 2023 11:36:33 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: sshd doesn't disconnect for 30+ minutes after the TCP connection is closed ungracefully From: Michael Gmelin In-Reply-To: Date: Wed, 1 Mar 2023 12:36:32 +0100 Cc: freebsd-net@freebsd.org Message-Id: <08DDB90C-5D30-40A3-86C0-87021959F04D@freebsd.org> References: To: Yuri X-Mailer: iPhone Mail (20D67) X-Rspamd-Queue-Id: 4PRXJ43G59z4V3n X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:213.239.192.0/18, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > On 1. Mar 2023, at 11:35, Yuri wrote: >=20 > =EF=BB=BFWindows system connects to FreeBSD through ssh and then this conn= ection dies because of WiFi or VPN issues. >=20 > FreeBSD still has the sshd process alive for this connection for 30+ minut= es. >=20 > TCP keepalive is enabled on the FreeBSD host: >=20 > $ sysctl net.inet.tcp.always_keepalive > net.inet.tcp.always_keepalive: 1 >=20 > Shouldn't TCP keepalive kill this sshd process after 3-4 minutes because t= his connection isn't alive? >=20 Keepalives start after net.inet.tcp.keepidle milliseconds (2h by default). Cheers