From owner-freebsd-stable@freebsd.org Mon Aug 20 14:59:24 2018 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0141A1070B76 for ; Mon, 20 Aug 2018 14:59:24 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 916F071037 for ; Mon, 20 Aug 2018 14:59:23 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id B8F7125D37D1; Mon, 20 Aug 2018 14:59:20 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 17849D1F8E6; Mon, 20 Aug 2018 14:59:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id LhTCHd0T4Ntq; Mon, 20 Aug 2018 14:59:17 +0000 (UTC) Received: from [192.168.124.1] (fresh-ayiya.sbone.de [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 981EED1F868; Mon, 20 Aug 2018 14:59:17 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Stefan Bethke" Cc: "FreeBSD Stable" Subject: Re: Bind to port <1024 in jail Date: Mon, 20 Aug 2018 14:59:16 +0000 X-Mailer: MailMate (2.0BETAr6116) Message-ID: In-Reply-To: <75536186-7D58-498C-BFC6-9284EB7CB444@lassitu.de> References: <75536186-7D58-498C-BFC6-9284EB7CB444@lassitu.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 14:59:24 -0000 On 20 Aug 2018, at 14:47, Stefan Bethke wrote: > I have a Go program (acme-dns) that wants to bind 53, 80, and 443, and > I’d rather have it run as a non-privileged user. The program > doesn’t provide a facility to drop privs after binding the ports. > I’m planning to run it in a jail. > > After some googling, it appears that a couple of years ago I should > have been able to do: > sysctl net.inet.ip.portrange.reservedhigh=0 > and allow all processes to bind to „low“ ports. This does not work > in my jails on a 11-stable host. > > $ sudo sysctl net.inet.ip.portrange.reservedhigh=0 > net.inet.ip.portrange.reservedhigh: 1023 > sysctl: net.inet.ip.portrange.reservedhigh=0: Operation not permitted > > Securelevel should not interfere: > $ sysctl kern.securelevel > kern.securelevel: -1 > > Is there a way to allow regular processes to bind to low ports? you have to set it on the base system; alternatively with vnet you might be able to change it per-jail. /bz