From nobody Sat Oct 21 17:27:10 2023 X-Original-To: stable@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 4SCT0l2cNwz4xJNs for ; Sat, 21 Oct 2023 17:27:19 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::1]) (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 "hmo.in-vpn.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SCT0j4Dc9z4Ypn for ; Sat, 21 Oct 2023 17:27:17 +0000 (UTC) (envelope-from freebsd@oldach.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net; dmarc=none Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.17.2/8.17.2) with ESMTPS id 39LHRA15053743 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Sat, 21 Oct 2023 19:27:10 +0200 (CEST) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.17.2/8.17.2) id 39LHRAIv053742 for stable@freebsd.org; Sat, 21 Oct 2023 19:27:10 +0200 (CEST) (envelope-from freebsd@oldach.net) Message-Id: <202310211727.39LHRAIv053742@nuc.oldach.net> Subject: Re: Local sshd_config modifications In-Reply-To: from Miroslav Lachman at "20 Oct 2023 12:54:20" To: stable@freebsd.org Date: Sat, 21 Oct 2023 19:27:10 +0200 (CEST) From: freebsd@oldach.net (Helge Oldach) X-No-Archive: Yes List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Sat, 21 Oct 2023 19:27:11 +0200 (CEST) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Spamd-Bar: - X-Spamd-Result: default: False [-1.75 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.991]; NEURAL_HAM_LONG(-0.98)[-0.982]; NEURAL_SPAM_SHORT(0.53)[0.527]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[stable@freebsd.org]; DMARC_NA(0.00)[oldach.net]; FROM_EQ_ENVFROM(0.00)[]; FROM_NO_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[stable@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4SCT0j4Dc9z4Ypn Miroslav Lachman wrote on Fri, 20 Oct 2023 14:54:20 +0200 (CEST): > On 20/10/2023 10:41, Ben Stuyts wrote: > >> Include /etc/ssh/sshd_config.d/*.conf > >> Include /usr/local/etc/ssh/sshd_config.d/*.conf > > > > Noted, thanks. Personally I just use Include /etc/ssh/sshd_config.local, but I thought my initial solution would be more generic. > > > >> But search the internet first, there are reported bugs and headaches with Include and Match. > > > > I personally have not seen any problems when using Match with this. But it looks like this was fixed in 8.4, and FreeBSD (12.4) is running 9.1. > > > > Looking at it now, I see that I also had to disable the Subsection sftp part, as I sometimes redefine it in the local file. And sshd barfs on duplicate Subsections. > > Yes, this can be another problem. Cannot speak of sshd because I never > used Include with it but there are problems with e.g. sudoers.d or > syslog.d included files - sometimes there cannot be redefinitions or the > order of directives matters. Simple modifications can be added through rc.conf (or rc.conf.d/sshd): sshd_flags="${sshd_flags} -o UseBlackList=yes -o ClientAliveInterval=15" Does this perhaps work for the Include directive as well? Kind regards Helge