per user quotas inside jail?

Konstantin Belousov kostikbel at gmail.com
Fri Aug 23 16:06:00 UTC 2013


On Fri, Aug 23, 2013 at 09:24:32AM -0500, Valeri Galtsev wrote:
> Dear Experts,
> 
> After searching the web, reading FreeBSD Docs, trying some hacks found on
> some discussion boards... I feel it is not easily possible. Yet, as always
> there may be some expert who knows how to do it:
> 
> How can one have per user quotas inside jail?
> 
> Basically, I would like to give users shell access to some server, but
> that I prefer to have in jail, where I will mount all filesystems they
> need access to... and the only question is: how do I restrict them so one
> (or few) user doesn't fill up the whole filesystem. My mind is not married
> to any particular filesystem, UFS2, XFS, ZFS... - the only thing I would
> stay away from is NFS exporting on host and then NFS mounting in jail
> (which may be easiest if not the only way quota wise).

UFS quotas work regardless of jailed/non-jailed user.  The only confusing
issue is that quotas are per host uid.  In other words, if host and jail
user, or two users from different jails has the same uid, you get one
quota setting applied and accounted for them.

Usual mitigation is to ensure that user uids are globally unique.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-jail/attachments/20130823/cee5d43d/attachment.sig>


More information about the freebsd-jail mailing list