Allow Chroot VSFTPD User External File Access

Scenario: FTP user is jailed to their home directory with chroot. FTP user needs to access an external directory (such as www).

Normally you would create a symbolic link in the user’s home directory.

cd /home/user
ln -s /var/www/html/userdomain.com www

But for some reason, this just doesn’t work with VSFTPD. After fiddling with permissions unsuccessfully for a few minutes, I found a better way.

cd /home/user
mkdir www
mount –bind /var/www/html/userdomain.com www

So you could either do it this way, or use PROFTPD.



6 Comments so far

  1. iceolate @ September 23rd, 2008

    this might be useful for some people at work. though i don’t know how many it would actually apply to.

  2. David @ December 16th, 2008

    Cheers for the tip.

  3. David @ December 16th, 2008

    Cheers for the tip.

  4. bperove @ December 16th, 2008

    <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html>
    <head>
    <meta content=”text/html;charset=UTF-8″ http-equiv=”Content-Type”>
    </head>
    <body bgcolor=”#ffffff” text=”#000000″>
    <font size=”-1″><font face=”Georgia”>approve</font></font>

  5. Thor @ March 14th, 2009

    Tnx 4 this tip…I needed to allow users to upload their content to their webspace – so read/write rts were only needed to the one user for the one /var/www/[user]- be aware that rights have to be set appropriatly, though…

    Thor

  6. Pirsey @ April 22nd, 2009

    If you want to read a reader’s feedback :) , I rate this post for four from five. Decent info, but I have to go to that damn msn to find the missed pieces. Thanks, anyway!

Leave a reply

Add this site to your Firefox Search Bar

Twitter Updates


The line separating what's real and what isn't is becoming more and more obfuscated...

Follow Ben on Twitter

Recent Entries

Categories

Archives

This site is optimized for Firefox.