The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to move/change the ftp base directory ?

Discussion in 'General Discussion' started by pstein, Jan 13, 2007.

  1. pstein

    pstein Registered

    Joined:
    Jan 13, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Assume I setup a new ftp account for an existing user account.

    By default this ftp account has its base directory in

    /home/mydomain/public_html/

    Currently I can extend this initial ftp directory to sub directory like

    /home/mydomain/public_html/john/

    but I cannot change it to a completely different directory like

    /home/mydomain/ftponly/john/

    a) How do I change this intial ftp directory otherwise to
    /home/mydomain/ftponly/john/ ?

    Maybe I have to change some (perl) scripts (which ?) ?

    Or is the base ftp directory determined by some entries in
    passwd files (which ?) ?

    The ftp server used on the server is pure-ftpd

    b) Is there a way to define a base ftp directory for ALL ftp accounts
    simultaneously? In other words: All users should have their
    upper most intial base ftp from now on in

    /home/mydomain/ftponly/

    Peter

    Peter
     
  2. mwmconsulting

    mwmconsulting Member

    Joined:
    Apr 15, 2006
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Great question Peter.

    I too would like to know how this can be done. Is there some sort of cPanel configuration file that can be altered?

    I actually just want to automatically add "_ftp" to the directory name that automatically gets added. So, for example when the username typed in is "test" the directory name would default to be "test_ftp".

    Cheers to anyone who can help us.

    - Matthew
     
  3. Mad Matt

    Mad Matt Registered

    Joined:
    Nov 11, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    While you're there.......

    I've just seen a band-wagon and I'd like to jump on! Has anyone had a chance to look at this yet?

    Isn't the default also a bit insecure as if you can guess the username you can see the ftp files by going to www.yoursite.com/user ?

    Cheers,

    Matt.
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Ftp account above the public directory is only accessible by the cpanel owner. Anyone else will have access to public_html and lower only. By all means, you truly do not want a guest accessing above your public share directory and into your cpanel settings area.
     
  5. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36

    You can turn off indexing for any particular directory or site wide. Add this directive in the .htaccess file or create the .htaccess file and chmod to 0644 if you do not have one already.

    Add this directive and any directory existing below will inherit the setting.

    Options All -Indexes

    I create and put that directive in my servers home directory so every site has this setting as default. If you do need to turn it off for a certain directory or tree, simply use

    Options All +Indexes
     
  6. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I thought I had a reply for this from a previous thread. Took me forever to find it, didn't know it was all the way back in July of last year (I could have swore it was only a couple of weeks ago. My mind is already going).

    http://forums.cpanel.net/showpost.php?p=262427&postcount=4

    Basically, you just create an FTP account, point it to a dummy directory on the account, then edit the file /etc/vftp/%username% (where %username% refers to the username of the webhosting account) and replace the dummy directory with a directory outside of the public_html. This directory will also need to be created.

    Not sure if that still works or not, like I said I really didn't think it was that old of a thread.
     
  7. Chief Plasma

    Chief Plasma Registered

    Joined:
    Mar 7, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    if you have ssh access you could also create a link file to the other sub.
    example:
    mkdir foo
    ln -s foo file
    in ftp it shows file as a link you go there and you see the files in foo.

    I think i would still want these jailed up in the pubic_html folder some where.

    :)

    -cp
     
  8. Mad Matt

    Mad Matt Registered

    Joined:
    Nov 11, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks

    Thanks for the feedback. The point about .htaccess is a good one. The other points are too, but I new how to fix it by hand, I was looking for a way for CPanel to put the ftp directories elsewhere by default, so my admin user (who is not IT oriented) can still add ftp users.

    So, all in all, the Apache solution is probably going to win the day!

    Thanks for your help.

    Matt.
     
Loading...

Share This Page