ProFTPd user start/home folder

5 posts / 0 new
Last post
#1 Wed, 06/01/2011 - 07:31
LasseOK

ProFTPd user start/home folder

Hi guys

I've searched all over the place for an answer but can't seem to get it working.

I have a hosting-like setup where each customer gets a vhost and a folder on the server to contain the website files. That works.

But when I create a new virtual host I would like the top folder accesible to the FTP user to be ${HOME}/htdocs. How is that done?

I've tried setting these in the default vhost template:

DefaultRoot ${HOME}/htdocs
DefaultChdir ${HOME}/htdocs

But it still starts in just ${HOME} even though I can see that the chdir and DefaultRoot has been set to the right path.

Here is the ProFTPd template I use:

ServerName ${DOM}
DefaultRoot ${HOME}/htdocs
DefaultChdir ${HOME}/htdocs
<Anonymous ${HOME}/htdocs>
User ftp
Group nogroup
UserAlias anonymous ftp
<Limit WRITE>
DenyAll
</Limit>
RequireValidShell off
ExtendedLog ${HOME}/logs/ftp.log
</Anonymous>

(In Virtualmin Virtual Servers (GPL) > Server Templates > Default Settings > ProFTPd virtual FTP)

Any help would be greatly appreciated. Also, if you need more info just tell me.

Wed, 06/01/2011 - 10:38
andreychek

Howdy,

Well, normally you would achieve that by going into Limits and Validation -> FTP Directory Restrictions, enabling a restriction for user home directories.

Then, create a new FTP user by going into Edit Mail and FTP Users -> Add a website FTP access user.

That would create a user whose home directory is your DocumentRoot.

Would that do what you want, or did you really want that to work for the Virtual Server owner?

-Eric

Thu, 06/02/2011 - 10:23
LasseOK

Yay! That works. Thank you, Eric.

If you don't mind, I have one other question:

How do I setup ProFTPd and Virtualmin on a server with a shared IP? So that when I add a new virtual host, a matching FTP user is created?

The only thing I've been able to get working is the ProFTPd virtual FTP plugin. But it wants a new IP every time I create a new virtual host.

/Lasse

Thu, 06/02/2011 - 10:28
andreychek

Well, Virtualmin and ProFTPd should work just fine on a shared IP address.

Any user with an account on your server should be able to enter their domain name as the FTP host, and it will connect them to the ProFTPd instance running on your server.

There's only one user created by default though, that's the Virtual Server owner. If you want additional users created, you'd have to do that by hand.

-Eric

Thu, 06/02/2011 - 11:36
LasseOK

Oh, I see.

I just misunderstood the default configuration of ProFTPd.

With your help I got it working. Thank you very much!

/Lasse

Topic locked