1

I'm not sure what is the proper name of this but let me explain,

Bob is logging into ftp, he noticed that he is in his home and also sees somedir, otherdir and somefiles some day he decided to navigate to otherdir and he was not suprised when he seen someotherfiles however he had no idea what was happening behind the scenes, when he gone to otherdir he went from /home/ftp/bob/ to /var/magicaldir.

So in short, I want to map a physical directory so it can be accessed by the user as it would be in his home. How should I approach that?

Note: Security is not big concern, I use this as my home test server.

2 Answers 2

2

You can do this with a link and a change to the proftpd configuration.

Create a link from /home/ftp/bob to /var/magicaldir

ln -s /var/magical otherdir

Then edit /etc/proftpd/proftpd.conf, locate and comment out the DefaultRoot directive.

#Defaultroot     ~

Save the file and restart proftpd.

1

Symbolic link solution of above answer can broken due to chroot issue that was described here

As per Above document suppose we have ftp root as follows:

/path/to/ftp/

Now if anyone want to create symlink for /path/to/ftp/deep/level/directory/for/uploads as follows:

/path/to/ftp/uploads --> /path/to/ftp/deep/level/directory/for/uploads

This above link will not work instead following link will work:

/path/to/ftp/uploads --> deep/level/directory/for/uploads

Please note, proftpd will jail chrooted to user homedir. So, absolute path will not work. Also the path outside of "/path/to/ftp/" will not work.

I think the right direction of the question are discussed here ProFTPD module mod_vroot

Now, for mod_vroot will allow the signal for symlink options that solve the problem. You need to add following configuration.

<IfModule mod_vroot.c>
    VRootEngine on
    VRootOptions allowSymlinks
</IfModule>
2
  • 1
    Can you summarize these links?
    – muru
    Apr 9, 2015 at 5:11
  • 1
    ohh, sure, as in document of chroot. Proftpd dosen't support symbolink from outside of default ftp root. Cause the root of default path is start from "/" so if symlink point to outside of chrooted path it starts with "/" so the lookup will fail for that instance. On the other hand mod_vroot take directory from configuration file at the start time of proftpd, so it can create virtual root for any directory i.e. outside of default ftp root is possible. Apr 9, 2015 at 5:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .