Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    1

    Default How to move/change the ftp base directory ?

    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. #2
    Member mwmconsulting's Avatar
    Join Date
    Apr 2006
    Posts
    21

    Thumbs up 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
    ========================
    MWM Consulting, Inc.
    InSiteful Business Solutions
    http://www.mwmconsulting.biz
    ========================

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    2

    Default 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. #4
    Member
    Join Date
    Mar 2006
    Posts
    1,215

    Default

    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. #5
    Member
    Join Date
    Mar 2006
    Posts
    1,215

    Default

    Quote Originally Posted by Mad Matt View Post
    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.

    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. #6
    Member
    Join Date
    Aug 2002
    Posts
    1,118

    Default

    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.ph...27&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. #7
    Registered User
    Join Date
    Mar 2007
    Posts
    1

    Default

    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. #8
    Registered User
    Join Date
    Nov 2006
    Posts
    2

    Default 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.

Similar Threads & Tags
Similar threads

  1. Changing base directory
    By Julien PHAM in forum cPanel and WHM Discussions
    Replies: 11
    Last Post: 10-22-2009, 11:03 AM
  2. Change default FTP home directory for users
    By dagurk in forum New User Questions
    Replies: 2
    Last Post: 06-12-2008, 04:39 PM
  3. Change defalt directory for ftp
    By frediez in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-01-2007, 08:35 AM
  4. change move directory
    By romanus in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-02-2005, 12:21 PM
  5. How do I change the directory for an FTP account?
    By GaryW in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-14-2005, 07:28 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube