FTP only


I’d like to use Virtualmin for FTP only accounts.
I’ve created a plan, and disabled all features for it, except “Administration user” and “Home directory”.
But when I create an account with that plan, Virtualmin creates home directory with directories inside I don’t want: Maildir, cgi-bin, logs and public_html.
Is it possible to disable creation of those directories?
how to restrict FTP inside some directory (public_html for example)?



Unfortunately, it’s not possible to prevent those directories from being created.

However, if you wish to lock an FTP user into a particular directory, there are details on setting that up here in the section “How can I prevent FTP Users from Browsing the Entire Filesystem?”:



Thank you for the fast reply.
Is it possible to restrict FTP user inside of public_html?
I tried to do that in following way:
FTP Directory Restrictions - All Virtual servers - Other directory - $HOME/public_html
But I’m getting following error:
Failed to save FTP directory restrictions : Missing or invalid directory in row 1


To create a user whose homedir is in the public_html folder, you’d want to use the Edit Users -> Add a website FTP access user option.

That creates an FTP-only user, with a homedir inside the public_html folder.

Let us know if that resolves the issue you’re seeing!



Creating another FTP user is not exactly what I need.
I’m using WHMCS module for creating Virtualmin accounts, and it has no options for creating FTP users. It creates an account with specified plan and server template. The only feature I need is FTP, and I’d like to see just an empty folder after new account has been created.
So, if it’s not possible to prevent creating Maildir, cgi-bin etc., maybe there is a way to delete them immediately after account creation? Something like post-creation script…



I’ve created a simple script that removes unneccessary directories according to this: https://www.virtualmin.com/documentation/developer/prepost
It completely resolved my problem.

rmdir Maildir
rmdir cgi-bin
rmdir logs
rmdir public_html

Thanks for help.