From owner-freebsd-questions@FreeBSD.ORG Thu Sep 17 19:02:10 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A390A106568D for ; Thu, 17 Sep 2009 19:02:10 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 706EA8FC1E for ; Thu, 17 Sep 2009 19:02:09 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 098127E821; Thu, 17 Sep 2009 11:02:22 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Thu, 17 Sep 2009 21:02:07 +0200 User-Agent: KMail/1.12.1 (FreeBSD/8.0-BETA4; KDE/4.3.1; i386; ; ) References: <200909171914.29389.mel.flynn+fbsd.questions@mailing.thruhere.net> <20090917175533.GD34712@ei.bzerk.org> In-Reply-To: <20090917175533.GD34712@ei.bzerk.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200909172102.07287.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: Ruben de Groot , Tom Worster Subject: Re: passing options thru '/etc/rc.d/foo start' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2009 19:02:10 -0000 On Thursday 17 September 2009 19:55:33 Ruben de Groot wrote: > On Thu, Sep 17, 2009 at 07:14:29PM +0200, Mel Flynn typed: > > On Wednesday 16 September 2009 21:18:03 Tom Worster wrote: > > > On 9/16/09 2:37 PM, "Mel Flynn" > > > > > > wrote: > > > > On Wednesday 16 September 2009 20:21:40 Chris Cowart wrote: > > > >> Tom Worster wrote: > > > >>> thanks, Mel, that's good to know. > > > >>> > > > >>> i think your suggestion of modifying rc.conf will turn out to be a > > > >>> tidy solution for me. > > > >> > > > >> You could also just put: > > > >> > > > >> sshd_flags="-o X11Forwarding=no" > > > >> > > > >> into your /etc/rc.conf file. > > > > > > > > What he wants is passing arguments without touching config files, > > > > which I find myself needing sometimes as well, on machines where > > > > static partitions are mounted read-only + kern.secure_level. > > > > > > that's right. > > > > > > when i read in 11.7 of the handbook: "Since the rc.d system is > > > primarily intended to start/stop services at system startup/shutdown > > > time, ..." i thought: maybe i'm making things hard by trying to use > > > rc.d scripts when i could just execute the daemon's binary. > > > > One downside I forgot to mention: > > You do open yourself up now to SSHD_FLAGS="-o AllowRoot=yes", so you may > > need to complicate the logic a bit more, by sanitizing SSHD_FLAGS. > > Please explain how this can be exploited by a non-root user? By adding this to .profile of compromised wheel account and waiting for him to run sudo -E or using an older version of sudo. Yes, it's an unlikely path. More to the point, it defeats having ro mounted /etc + secure level, since no reboot is required to modify the running sshd, so you're compromising your failsafe. -- Mel