From owner-freebsd-questions@FreeBSD.ORG Wed Feb 1 19:26:15 2012 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 7FEEA106566B for ; Wed, 1 Feb 2012 19:26:15 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr10.xs4all.nl (smtp-vbr10.xs4all.nl [194.109.24.30]) by mx1.freebsd.org (Postfix) with ESMTP id 12E788FC14 for ; Wed, 1 Feb 2012 19:26:14 +0000 (UTC) Received: from slackbox.erewhon.net (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr10.xs4all.nl (8.13.8/8.13.8) with ESMTP id q11JPhEd029462; Wed, 1 Feb 2012 20:25:43 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.erewhon.net (Postfix, from userid 1001) id F11ED1235D; Wed, 1 Feb 2012 20:25:42 +0100 (CET) Date: Wed, 1 Feb 2012 20:25:42 +0100 From: Roland Smith To: Stas Verberkt Message-ID: <20120201192542.GA60624@slackbox.erewhon.net> References: <20120201073031.GA1678@homey.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <20120201073031.GA1678@homey.local> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: Re: Securely sharing directories between jails 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: Wed, 01 Feb 2012 19:26:15 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 01, 2012 at 08:30:31AM +0100, Stas Verberkt wrote: > L.S., >=20 > I want to set up my system in a way where applications are clustered > over jails, e.g. a httpd, smbd and dbmsd jail. However, in most cases I > need to share data over the jails, which is stored on the host. > Often, nullfs and mounting ro is suitable, but I need write access in > some cases. As nullfs rw over multiple jails can be considered insecure, > I was wondering what would be a secure way. You could use a combination of nullfs and unionfs. Below is is what I do to share /usr/ports on the host with a jail, but keep the jail from writing in the host's tree. host# cd /usr/local/var/jails/192.168.0.100/usr host# mkdir tmp/foo host# mount_nullfs /usr/ports/ ports/ host# mount_unionfs -o noatime tmp/foo ports/ With this, the jail sees the hosts' /usr/ports tree, but when it wants to write there, the written files end up under tmp/foo in the jails' tree. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8pkbYACgkQEnfvsMMhpyVkcACgqRxA4IKFdoyHwaDx8T3+9G3v lTwAoIg3cZ1dwciHFsKd5/Cgmx7V6rDU =dmFW -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ--