How to install Vsftpd with virtual users in Debian

Valic —  July 2, 2010 — 2 Comments

About: Vsftpd is a GPL licensed FTP server for UNIX systems, including Linux. It is secure and extremely fast. It is stable. Don’t take my word for it, though. Below, we will see evidence supporting all three assertions. We will also see a list of a few important sites which are happily using vsftpd. This demonstrates vsftpd is a mature and trusted solution.

Step 1. Installation:

apt-get install vsftpd

Step 2. Configuration:

First open the config file:

pico /etc/vsftpd.conf

Then modify these variables in the config:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=NO
nopriv_user=vsftpd
virtual_use_local_privs=YES
guest_enable=YES
user_sub_token=$USER
local_root=/home/$USER
chroot_local_user=YES
hide_ids=YES
guest_username=vsftpd
listen_port=21

Step 3. You will need to install libpam-pwdfile
PAM module allow you to authenticate via an /etc/passwd-like file.

apt -get install libpam-pwdfile

Step 4. Configure PAM to check the passwd file for users

auth required pam_pwdfile.so pwdfile /etc/vsftpd.users
account required pam_permit.so

Step 5. Add ftp users :

htpasswd -c /etc/vsftpd.users firstftpuser

-c  will be user ONLY at fisrt user created. If you will use -c at second user, the first user will be lost.

For create another user you will use the command :

htpasswd /etc/vsftpd.users anotheruser

You will be asked for password for every user that you’ll create.

Step 6. Create a local user that is  used by the virtual users to authenticate

useradd –home /home/vsftpd –gid nogroup -m –shell /bin/false vsftpd

Step 7. Restart ftp server

/etc/init.d/vsftpd restart

Done

Valic

Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

2 responses to How to install Vsftpd with virtual users in Debian

  1. thank,please explain more about:
    how can windows and linux user access to some folder in server?
    for example i have folder “lko” in home directory in debian server and i want some user login with ftp for upload file.
    note:i have setup domain “hoss.bit” i think i need domain for use ftp like “ftp.hoss.bit”

  2. just follow the tutorial and create one user with home directoryt in “lko”.

Leave a Reply