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.

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

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.

[code]
cd /home/user
mkdir www
mount --bind /var/www/html/userdomain.com www
[/code]

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

 

About Benjamin Perove

Benjamin has been associated with computer technology starting from a very early age, and has contributed to the success of many businesses and enterprises since 2001. He loves to crush pow at Keystone, play acoustic guitar, climb rocks, and ascend mountains on his road bike. Benjamin is an Avalanche fan and currently resides in Boulder, Colorado.

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


No public Twitter messages.

Recent Entries

Topics

Archives

This site is optimized for Firefox.