PROFTPD virtual user – quick howto

It was boring to look for it in PROFTPD docs - but I could not find quick FAQ, so I had no choice. Anyway I decided to write it for others who need quick tip. Here are 4 simple steps to create virtual user account.

1. Download "ftpasswd" perl script and chmod it to 755:

wget http://www.castaglia.org/proftpd/contrib/ftpasswd
chmod 755 ftpasswd

2. Create file with your virtual user and ftp group

mkdir /etc/proftpd
ftpasswd --passwd --name=ftp_login --home=/home/ftp/ftp_login --shell=/bin/false --uid=1003
ftpasswd --group --name=ftp_group --gid=50 --member=ftp_login

(it is not important what UID and GID you will use as long as it does not have root privileges :), just use any system uid and group and proftpd will write files with it's privileges)

3. Add this to your proftpd.conf file:

RequireValidShell  off
AuthUserFile  /etc/proftpd/ftpd.passwd
AuthGroupFile /etc/proftpd/ftpd.group

4. Restart PROFTPD

killall -HUP proftpd

That's all! Any questions? Post it below ;)

25 Responses to “PROFTPD virtual user – quick howto”


  • You rock! Was so bored with those freaking docs and you had a concise howto. Thank you!

  • Great:) Thanks for this howto.
    .-= nessip´s last blog ..Mam talent =-.

  • How do I change the permission to write for a virtual user? I just want one ftp-account to access the /var/www directory.

    Thanks in advance.

  • Just a quick note for anyone who might be having trouble: When i tried this procedure the two files
    ftpd.passwd and
    ftpd.group

    were created in my home directory, so I had to copy them into /etc/proftpd/ before I got it to work:

    “mv ~/ftpd.* /etc/proftpd/”

    Restarted FTP (which in my case I had to via xinetd (“/etc/init.d/xinetd restart” ) and it worked fine!!!

    To make sure that no user is able to go outside of their home directory (so that they are ‘sandboxed’ in), additionally add this to proftpd.conf:

    DefaultRoot ~

  • hi, i downloaded the file and im in the correct directory:

    but i get:

    “ftpasswd: command not found”

    im running debian. any help?

  • Im trying to get the ftpasswd to work on CentOS 32-bit, but when i try ftpasswd. I get errors in the script …

    ftpasswd: line 28: use: command not found
    ftpasswd: line 30: syntax error near unexpected token `(‘
    ftpasswd: line 30: `use File::Basename qw(basename);’

    Any ideas?

  • Very good howto. All is working just fine :-)

  • –name=ftp_login: command not found

  • how do I change password for user?

  • Thanks for the great tutorial. To add:

    If you’re trying to match the UID+GID of a systems user and their UID/GID are different, you’ll need to specify –gid=[ID] when creating the user.

    In the .conf, my AuthOrder now looks like:

    AuthOrder mod_auth_unix.c mod_auth_file.c

    (Auth against system users first, then virtual users)

  • Hi All,

    Maybe somebody know how can add grants to e.g. list directories for all virtual users from ftpd.passwd file

    I have configuration:
    Include /etc/proftpd/modules.conf

    ServerType standalone
    DefaultServer on
    UseIPv6 off

    UseReverseDNS off
    IdentLookups off
    ServerIdent off

    ServerName “ftp”

    DisplayLogin welcome.msg

    DeferWelcome on

    MultilineRFC2228 on

    ShowSymlinks on

    TimeoutNoTransfer 600
    TimeoutStalled 600
    TimeoutIdle 1200

    DisplayChdir .message true

    DenyFilter \*.*/

    RootLogin off

    DefaultRoot ~

    ListOptions “-l”

    RequireValidShell off

    AuthUserFile /etc/proftpd/ftpd.passwd

    Port 21

    # PassivePorts 49152 65534
    # MasqueradeAddress 1.2.3.4

    # This is useful for masquerading address with dynamic IPs:
    # refresh any configured MasqueradeAddress directives every 8 hours

    # DynMasqRefresh 28800

    MaxInstances 30
    User proftpd
    Group nogroup

    # 022 => 755 , 077 => 700 , 002 => 775

    Umask 022 022

    AllowOverwrite on

    TransferLog /var/log/proftpd/xferlog
    SystemLog /var/log/proftpd/proftpd.log

  • Do I need so?

    DefaultRoot /home/ftp
    AuthUserFile /etc/proftpd/ftpd.passwd
    AuthGroupFile /etc/proftpd/ftpd.group

    And how to configure directory access?

  • I’m sorry but after trying this tutorial I still get this
    Response: 530 Login incorrect.
    Error: Critical error
    Error: Could not connect to server
    And I have configured the username and password correctly.

  • You are the man…
    After failed to setup vsftpd at Ubuntu 12.04 x64.
    At this time success with proFTP using virtual user.

    Thanks alot.

  • Amazing !!! its working in command line but in browser or firefox not working.. pls let me know..

  • after following this tutorial, i can’t login into ftp using user that created from command ftpasswd

    it’s something wrong?

    please help me

  • How can I add multiple users to one group ?

    • Great little tutorial. I just added another ftp user with a new name that is linked to a different directory by using the first line of the ftpasswd command except that at the end of the command I added —gid= and it appended that onto my existing ftpd.passwd file. The user doesn’t show up in the ftpd.group file but that doesn’t seem to matter, the user can ftp in to the directory I’ve assigned for that user.

  • I found that my virtual users couldn’t write to the ftp directories that I was sending them to. But if you do a getent group you can see all of your groups and their GID numbers. In my setup all of my web server stuff is owned by www-data and so I edited the ftpd.passwd file and changed my users GID to the www-data group and now they have write access to their directories.

Leave a Reply