I need an absolutely minimal chroot environment that only has a few commands to handle files & directories. No usermanagment or such. Since I want to create such an environment for every of my users, it must be really, really small.

Are there any prebuilt environments that fit my needs an are 5-10 MB (or as small as possible) ?

Or are there alternative ways to limit a user to a directory and to only a few commands?

Thanks for your help!

link|improve this question
feedback

2 Answers

FreeBSD jails.

In Linux, there is OpenVZ and hypervisors (Xen, KVM) - they are used to provide VPS hosting solutions. The latter does not fit into 5-10 MB, however.

And if you just want file operations (not running external processes), it may be a good idea to write your own shell and filter command arguments by regular expressions. It would be under 200 lines of Google Golang code, I think.

link|improve this answer
feedback

This script may come in handy.

http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/

looks like just enough to upload, download, rsync files, etc.

I think you will then have to implement quotas to keep them from using too much disk space.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.