3

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?

0

1 Answer 1

5

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).

4
  • The /path/to/chroot is that the user his home directory? In my sshd_config file I set: ChrootDirectory %h Commented Sep 4, 2012 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. Commented Sep 4, 2012 at 15:47
  • and how do I unbind? never mind: I was able to do it using umount Commented Sep 4, 2012 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 Commented Jul 9, 2015 at 15:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.