From nobody Tue Jun 27 02:00:08 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 4QqnwS2s0cz4hdR9; Tue, 27 Jun 2023 02:00:08 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (www.zefox.net [50.1.20.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "www.zefox.com", Issuer "www.zefox.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QqnwR0X17z3pdB; Tue, 27 Jun 2023 02:00:06 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of fbsd@www.zefox.net has no SPF policy when checking 50.1.20.27) smtp.mailfrom=fbsd@www.zefox.net; dmarc=none Received: from www.zefox.net (localhost [127.0.0.1]) by www.zefox.net (8.17.1/8.15.2) with ESMTPS id 35R209jA080254 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 26 Jun 2023 19:00:09 -0700 (PDT) (envelope-from fbsd@www.zefox.net) Received: (from fbsd@localhost) by www.zefox.net (8.17.1/8.15.2/Submit) id 35R208dc080253; Mon, 26 Jun 2023 19:00:08 -0700 (PDT) (envelope-from fbsd) Date: Mon, 26 Jun 2023 19:00:08 -0700 From: bob prohaska To: Jamie Landeg-Jones Cc: freebsd-net@freebsd.org, freebsd-arm@freebsd.org Subject: Re: -current dropping ssh connections Message-ID: References: <202306212305.35LN5ITH069587@donotpassgo.dyslexicfish.net> <202306222238.35MMcoQm017939@donotpassgo.dyslexicfish.net> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202306222238.35MMcoQm017939@donotpassgo.dyslexicfish.net> X-Spamd-Result: default: False [-1.09 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.99)[-0.991]; MID_RHS_WWW(0.50)[]; WWW_DOT_DOMAIN(0.50)[]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:7065, ipnet:50.1.16.0/20, country:US]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-net@freebsd.org,freebsd-arm@freebsd.org]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[zefox.net]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4QqnwR0X17z3pdB X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N On Thu, Jun 22, 2023 at 11:38:50PM +0100, Jamie Landeg-Jones wrote: > bob prohaska wrote: > > > That seems worth a try. > > The notion of an ssh escape (~. in this case) finding its way into the data stream is new to me. > > Thinking again, that looks like corruption coming down the ssh connection. > For the ssh escape char to affect anything (note it needs to be preceeded > by a new line) it would have to be sent up the line. > > For an example, assuming ssh has the default escape char, look at the difference between: > > printf 'pwd;\n~.;echo sleeping.; sleep 5' | ssh -tt user@host > > and with the same printf, but no escape char: > > printf 'pwd;\n~.;echo sleeping.; sleep 5' | ssh -tt -e none user@host > > You can see how the former closes the connection due to the \n~. > > (The -tt forces a terminal/interactive session to be set up - normally, as we are > piping input to ssh in this case, the terminal isnt set up, and the escape character > isn't used - it's only recongnised in interactive sesions by default) > > I personally have "EscapeChar none" in my ssh_config, but I suspect this > is probably not the issue here, still, can't hurt to try it! Indeed, connection was dropped with escape character set to none. There does seem to be a some dependence on system load. Connections survive at light or no load and drop when the sshd side is busy. Thanks for writing! bob prohaska