Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have multiple folders in /var/www for different websites -- Apache uses name-based Virtual Hosts (Ubuntu Server). Suppose I want to allow someone to access their /var/www/user directory, but not cd out of it and be able to traverse the system.

I found information about an OpenSSH Jail here:

Has anyone used/implemented something like this? Is there a better way aside from basic permissions to control this?

share|improve this question
possible duplicate of How can I chroot ssh connections? – mailq Sep 17 '11 at 23:27
up vote 4 down vote accepted

I recently implemented it for a client. The concern was that many sensitive files are readable by anyone with SSH access, so I followed the instructions on Limiting Access with SFTP Jails on Debian and Ubuntu at Linode and it has worked fine since.

I did have to fiddle around with permissions quite a bit -- permissions have to be set exactly as described. Also, I found error messages (I think in /var/log/auth.log) to be surprisingly helpful.

share|improve this answer
Thanks for the info! – Trent Scott Sep 19 '11 at 1:49

Your Answer


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.