I was recently using Jailkit on Ubuntu to set up a chroot environment for users of a backup storage server. I wanted to give the users the ability to check their quotas with the regular quota command.
I go about telling Jailkit that the chroot directory will need the quota binary. This should be all that is needed, or so I thought.
Upon checking a quota as a chroot'd user, it barfs the following error,
1 2 3 4
From what I can tell, this is a very misleading error message. The permissions of aquota.user are always 0600, readable / writable only by root. This can't be changed, not even as root. Witness.
Using a bit of strace and some luck, I find what the quota command is really looking for is /proc/sys/fs/quota.
It simply does a stat() system call on that directory within proc, so if you simply do,
then the quota command works like a charm within the chroot environment.
1 2 3 4 5
My chroot directory in these examples was obviously /home/bkusers, modify accordingly for your needs.