Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tried to give proftpd virtual users access to directories outside their home paths using symlinks I created as root through the console.

/var/ftp/users/test is the home of the user named test.
/var/ftp/files/documents is the directory that holds the documents, and /var/ftp/users/test/documents is the symlink that points to it.

But when an user connects to the FTP and tries to follow the symlink, he only sees this error:

documents: No such file or directory

What am I doing wrong?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Symlinks are locked into the jail the same way the user is; otherwise it would be possible for the user to break out of the jail with cd documents. (No, root-created symlinks can't be treated specially, for the same reason that cd -P symlink-to-dir; cd .. leaves you in the wrong place; the appearance of it working as you'd expect is an illusion created by the shell.) Use a bind mount instead (mount --bind /var/ftp/files/documents /var/ftp/users/test/documents).

share|improve this answer
    
This needs to be done every time the server restarts, right? –  Sebastián Grignoli Apr 4 '11 at 4:51
1  
Yes; you'll want to put it in /etc/fstab. –  geekosaur Apr 4 '11 at 4:52
    
Thank you very much! –  Sebastián Grignoli Apr 4 '11 at 5:07
1  
Just for example to help anyone else out, here are the mount and fstab quivelants: mount mount --bind /path/to/original/directory /path/to/mountpoint fstab /path/to/original/directory /path/to/mountpoint none bind 0 0 –  Benjamin Kaiser Apr 7 '13 at 23:33

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.