Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 a machine running Ubuntu 12.04 LTS with OpenSSH server installed. I have created a user with a jailed home account.

When I log in with the user's account, I can only access his home (duh).

In addition to the user's home folder, I would like to give the him read access to a particular partition (/Volumes/Storage). How can I do this?

share|improve this question
up vote 5 down vote accepted

You will need to ensure that the chroot that the users is put in has access to the directory by bind mounting into the chroot tree:

mount --bind /Volumes/Storage /path/to/chroot

The user will also need to have necessary filesystem permissions to read the data on the drive. The easiest way to accomplish this would be to put the user in a supplementary group that has ownership of the files (assuming standard 755 and 644 permissions).

share|improve this answer
The /path/to/chroot is that the user his home directory? In my sshd_config file I set: ChrootDirectory %h – Vincent Sep 4 '12 at 15:43
@user21670 - No, its the root of the chroot. It can be anywhere inside of the chroot, including the user's home directory. – jordanm Sep 4 '12 at 15:47
and how do I unbind? never mind: I was able to do it using umount – Vincent Sep 4 '12 at 15:51
To make this permanent (i.e. so it will work after reboot), add the following line to /etc/fstab: /Volumes/Storage /path/to/chroot none bind 0 0 – tjanez Jul 9 '15 at 15:01

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.