Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Currently my users are chrooted to /srv/www, but I want to give my users access to another directory /Zend/. Is there a way to do this?

I am using Debian 6.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Generally speaking, chroot's designed to not let this happen unless you explicitly do something to make one of the directories appear as a true descendant of the other (not with a symlink).

This can be done in various ways on various Unix-likes (for example, with null mounts in FreeBSD). The ProFTPd chroot reference page has a nice summary of doing this on various systems:

Linux (as of the 2.4.0 kernel):
  mount --bind /var/ftp/incoming /home/bob/incoming
  mount --bind /var/ftp/incoming /home/dave/incoming
or, alternatively:
  mount -o bind /var/ftp/incoming /home/bob/incoming
  mount -o bind /var/ftp/incoming /home/dave/incoming
BSD (as of 4.4BSD):
  mount_null /var/ftp/incoming /home/bob/incoming
  mount_null /var/ftp/incoming /home/dave/incoming
Solaris:
  mount -F lofs /var/ftp/incoming /home/bob/incoming
  mount -F lofs /var/ftp/incoming /home/dave/incoming

EDIT: Adding some Debian-specific detail, your mount might be something like:

mount -o bind /true/path/to/Zend /srv/www/Zend

... which would show up as /Zend if your users are chrooted to /srv/www.

share|improve this answer
    
I have Debian 6 btw. –  Doug Dec 11 '11 at 7:12
    
Debian should support mount -o bind -- see wiki.debian.org/chroot –  Royce Williams Dec 11 '11 at 7:56
    
Today, I learned more about fstab, and mount. Amazing resource link! –  Doug Dec 11 '11 at 9:03

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.