Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 4 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
add comment

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.