Need ProFTPd to follow symbolic link

I have 2 folder:

/var/www/project1/
/var/www/repository/module/

and I have this symbolic link:

/var/www/project1/module/News => /var/www/repository/module/News

I know the target is outside the ftp root folder. But I want to make proFTPd to be able to display&follow that symbolic link. The security is NOT a matter, we use that FTP on the local network for development purpose only.


Ps.: I also use GADMIN-PROFTPD, and I installed everything by default, using apt-get install.


Solution 1:

In case someone is still searching for an answer, from the documentation of Proftpd :

Filesystem Tricks A typical scenario is one where "DefaultRoot ~" is used to restrict users to their home directories, and where the administrator would like to have a shared upload directory, say /var/ftp/incoming, in each user's home directory. Symbolic links would normally be used to provide an arrangement like this. As mentioned above, though, when chroot(2) is used (which is what the DefaultRoot directive does), symlinks that point outside the new root (the user's home directory in this case) will not work. To get around this apparent limitation, it is possible on modern operating systems to mount directories at several locations in the filesystem.

To have an exact duplicate of the /var/ftp/incoming directory available in /home/bob/incoming and /home/dave/incoming, use one of these commands:

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

The same technique can be used for directories, which also operate in a chroot()ed environment. Also, it should be possible to mount specific files this way, in addition to directories, should you need to (a directory is just another file in Unix).

As usual, more information can be found by consulting the man pages for the appropriate command for your platform. The commands for other flavors of Unix will be added as needed.

In order to have these tricks persist, to survive a system reboot, the /etc/fstab (or /etc/vfstab) file may need to have these mounts added. Consult your local fstab(5) (or vfstab(4) for Solaris) man pages for more information.

Solution 2:

I think you have to make the DefaultRoot path more loose, I'm afraid proftpd cannot handle symlinks outside this chroot jail. So basically you can symlink, but only inside the DefaultRoot folder.