From owner-freebsd-jail@freebsd.org Thu Dec 8 20:42:45 2016 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BCC7C6E68B for ; Thu, 8 Dec 2016 20:42:45 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C54981DE7 for ; Thu, 8 Dec 2016 20:42:43 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 83D4328483; Thu, 8 Dec 2016 21:42:40 +0100 (CET) Received: from illbsd.quip.test (ip-86-49-16-209.net.upcbroadband.cz [86.49.16.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 908B228475; Thu, 8 Dec 2016 21:42:39 +0100 (CET) Subject: Re: ZFS and Jail :: nullfs mount :: nothing visible from host To: SK , freebsd-jail References: <584986D0.3040109@quip.cz> <2b6346f8-ed02-0e6d-bd89-106098e7eb2d@cps-intl.org> <58499446.3050403@quip.cz> From: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <5849C5BF.7020005@quip.cz> Date: Thu, 8 Dec 2016 21:42:39 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2016 20:42:45 -0000 SK wrote on 2016/12/08 20:13: > Initially they were not visible from within the jail, but as I ran > zfs jail testJail gT/JailS/testJail > they were visible from inside. You can add zfs jail testJail gT/JailS/testJail to your jail.conf post exec so it will be executed automatically. > HOWEVER, I am unable to do any manipulation whatsoever from within the jail. > root@testJail:/ # zfs list > NAME USED AVAIL REFER MOUNTPOINT > gT 10.3G 199G 9.51G legacy > gT/JailS 832M 199G 20K /JailS > gT/JailS/testJail 546K 199G 827M /JailS/testJail > root@testJail:/ # zfs snapshot gT/JailS/testJail@test > *cannot create snapshots : permission denied* > root@testJail:/ # zfs create gT/JailS/testJail/test > *cannot create 'gT/JailS/testJail/test': permission denied* > root@testJail:/ # exit zfs list is good start. I never used zfs from within jail so I cannot comment on permission denied. I don't know what more must be done. > Even after the jail was able to see the dataset, the following sysctl > was still zero > security.jail.mount_zfs_allowed: 0 I think you don't need this sysctl, you just need to set proper jail options like allow.mount allow.mount.zfs and enforce_statfs (per jail) > I changed it to one, but that didn't seem to have the desired effect > (should have I restarted?) No restart needed. Sysctls are runtime configurable. If you need to preserve some sysctl settings after reboot you must put them in to /etc/sysctl.conf > below are some of the relevant settings. If you require any other > information, I'll try to send them as soon as I can. Send us `sysctl security.jail` from host and from jail too.