Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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