Ftp – Configuring Proftpd users without system users

freebsdftpproftpd

I'm running a web server with proftpd on FreeBSD 9.

I want to add few ftp users to the server so they will have the option to upload files to their own sites.

When trying to do it with proftpd i need to use the system's adduser command to first create the user in the system itself.

Is there any way to avoid it?

I read about virtual users but i can't seem to find any guide to configuring it step by step

Thanks

Best Answer

Simple ftp site

<VirtualHost ftp.example.net>
   # Common settings
   ServerName "ftp.example.net"
   DefaultRoot ~
   DefaultServer on
   Umask 002

   Protocols ftp
   Port 21

   # Specify where the server should find our users
   AuthOrder mod_auth_file.c*
   AuthUserFile /etc/proftpd/virtual_users.passwd home ^/vhosts/example.net

   # Only users alex and john will be able to login
   <Limit LOGIN>
      AllowUser alex john
      DenyAll
   </Limit>

</VirtualHost>

Create virtual users

# ftpasswd --passwd --file /etc/proftpd/virtual_users.passwd --sha512 --gid 99 --uid 99 --shell /sbin/nologin --name alex --home /vhosts/example.net/site1/public_html
# ftpasswd --passwd --file /etc/proftpd/virtual_users.passwd --sha512 --gid 99 --uid 99 --shell /sbin/nologin --name john --home /vhosts/example.net/site2/public_html