Question about setting FTP User root folder

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Question about setting FTP User root folder

Post by RobertGonzalez »

My dedicated server (Linux Fedore Core 2) uses ProFTPD 1.2.10. I want to set up a domain for testing development projects and allow users FTP access to certain folders that are under public_html for this domain (essentially making sub accounts for this domain). Is there a way in Linux to set an FTP users root folder to something other than the public_html folder?

As always, any help is much appreciated.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

I've never attempted it but, I'm interested in hearing the solution.

I can offer a guess.

Because PAM handles authentication, your answer may be there and not in the proftd conf file.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

You could try changing the DefaultRoot setting:

Code: Select all

DefaultRoot ~/public_html/some_dir
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

You have to edit the proftpd conf file located in /etc/. Another solution is to create a new Linux account with the specified home directory, then login as that user. I can't be any more specific as I have never done this, I usually mount remote drives on my local filesystem using either ssh or samba.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I looked in /etc/ and found no proftpd.conf. In fact, I can't seem to find proftp anything. I found one lftp.conf and a few vsftp items. Do you think my host is using a different FTP server than ProFTP?

EDIT: Google is my friend. I found a bunch of information on the "Very Secure FTP Server" AKA vsftp. I think that ProFTP is indeed NOT on my server, but instead, VSFTP.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

If you would find it easier to mount it locally, try..

http://ubuntu.wordpress.com/2005/10/28/ ... ing-sshfs/ if your on linux

or

http://www.sftpdrive.com/ if your on windows.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

I have found that the simplest way to do this is to create symbolic links in the public_html directory that point into the user's home directory. That way the user accounts are configured normally and I can easily add, remove or move the symbolic links as needed. I hate having to learn configuration for yet-another-FTP-server, so symbolic links are the easy way to solve the problem from the other direction.
(#10850)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I think there is a way to do this using the configuration file. There is a directive that mentions how to automatically chmod a user when they login. But there is nothing that talks about how to keep a user locked into a certain root. I am totally new at Linux so this is all Greek to me. I'll figure it out sooner or later though. Thanks for all the help.
Post Reply