How to setup VSFTPD

How to Setup VSFTPD for FTP accounts.
Description:
"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.
Features:
Despite being small for purposes of speed and security, many more complicated FTP setups are achievable with vsftpd! By no means an exclusive list, vsftpd will handle:

* Virtual IP configurations
* Virtual users
* Standalone or inetd operation
* Powerful per-user configurability
* Bandwidth throttling
* Per-source-IP configurability
* Per-source-IP limits
* IPv6
* Encryption support through SSL integration

NOTE: Please read this page as a reference before continuing on. As it may help, some references might relate to Ubuntu Linux.

I wont go over how to install vsftpd but for the sake of Ubuntu fans, enter in:

sudo apt-get install vsftpd

First lets find the configuration file of vsftpd
-For ubuntu users, its located at "/etc/vsftpd.conf"
-For others, you can issue the locate / find command:

locate vsftpd | grep conf

Now lets edit vsftpd.conf using your favourite text editor, mine is nano.

sudo nano /etc/vsftpd.conf

I will run over the configuration file on some important settings:

Anonymous enable: This enables Anonymous ftp login, I suggest you disable this option unless you have certain files that you want to share with the everyone in the world.

anonymous_enable=NO

local_enable: Do you want local users on your system to be enabled to log in?

local_enable=YES

write_enable: Change this to yes if you want to allow uploads and file changes

write_enable=YES

chroot_local_user: This restrict users to their home directory, I suggest you turn this on.

chroot_local_user=YES

chroot list: If you enabled chroot_list_enable to yes then the list file becomes a file where you can put names of users who you 'dont' want to restrict to their home directory.

chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

You might need to create a 'vsftpd.chroot_list' in /etc directory or where ever you want.

secure_chroot_dir: If you enabled chrooting users to their home directory, then you must create empty directory which isn't owned by any of the ftp users. In my case, I used '/var/run/vsftpd' which is owned by root.

secure_chroot_dir=/var/run/vsftpd

local_max_rate: You can limit fast users can download from your ftp server, my upload speed is bout 100kb/s, to leave head room for my personal and other server use, I halfed it.

local_max_rate=50000

max_clients: How many users do you want at the same time? I limited it to about 2.

max_clients=2

max_per_ip: How many logins do you allow from the same IP address at a time. I personally used 1

max_per_ip=1

Restart VSFTPD to take effect:

sudo /etc/init.d/vsftpd restart

If you want users to access other file's/directory's like out of their home location and still want to restrict them every where else then read this

Comments

Hi im using an Ubuntu 7.10

Hi im using an Ubuntu 7.10 desktop. Ive tried to setup a VSFTPd server and i have been successful. I dont want anonymous login to be enabled so ive changed the .conf file as specified. I have created a user useradd -m example_user passwd P@ssw0rd When i log in from another desktop using ftp 10.0.0.4(ip add of my server) and log in as example_user with P@ssw0rd the log in is successful. When i go ls -l it lists only the contents of the home directory. I dont want the user to be restricted to this. I want to create a lot of users who can upload and download files from a fixed file directory(and only from this fixed file directory). All the users i create must be able to upload and download to/from this directory.. how can i set this up? please help...im really new to linux so if someone could explain it step by step i would be soo greatful

Try referring to

need help to login with vsftpd

Hello, everyone! I have some difficulties with logging on to vsftpd. I think it's more related to user/folder permissions, but it might be something else as well. If you have any idea why it doesn't work, please let me know. Please take a look at the details of my server. I won't post the entire message again here because it's pretty long. http://www.afp548.com/forum/viewtopic.php?showtopic=20920 I'm running OS X 10.4 (8.11.1 Darwin Kernel), so please disregard the specific locations (opt/local/etc instead of /etc). Thank you, Bogdan

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You may post PHP code. You should include <?php ?> tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
  _____   _____   _    ___  
|___ | |___ | / | / _ \
/ / / / | | | (_) |
/ / / / | | \__, |
/_/ /_/ |_| /_/
Enter the code depicted in ASCII art style.