FTP only

6 posts / 0 new
Last post
#1 Thu, 04/30/2015 - 08:40
evolver

FTP only

Hello,

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? or how to restrict FTP inside some directory (public_html for example)?

Thanks.

Thu, 04/30/2015 - 12:30
andreychek

Howdy,

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?":

https://www.virtualmin.com/documentation/security/faq

Thu, 04/30/2015 - 14:19
evolver

Hi,

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

Thanks.

Thu, 04/30/2015 - 15:06
andreychek

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!

-Eric

Thu, 04/30/2015 - 15:28
evolver

Hi,

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

Thanks.

Fri, 05/01/2015 - 05:54
evolver

Hi,

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.

#!/bin/sh
if [ "$VIRTUALSERVER_ACTION" = "CREATE_DOMAIN" ]; then
  cd $VIRTUALSERVER_HOME
  rmdir Maildir
  rmdir cgi-bin
  rmdir logs
  rmdir public_html
fi

Thanks for help.

Topic locked