Building a VSFTPD server on EC2 Linux

For starters do the following in the AWS console:

  1. First create a new server e.g. use the Default 64 bit Amazon Linux instance
  2. Create a new security group when you create the server
  3. To theĀ 
  4. Create an Elastic IP and associate with the instance

First install vsftpd: sudo apt-get install vsftpd

Edit /etc/vsftpd.conf and make sure you have the following settings

  • anonymous_enable=no
  • local_enable=yes
  • write_enable=yes
  • chroot_local_user=yes
  • userlist_file=/etc/vsftpd.userlist
  • userlist_enable=YES
  • userlist_deny=NO
  • pasv_max_port=41000
  • pasv_min_port=40000
  • port_enable=YES
  • pasv_enable=YES
  • pasv_address=<Elastic IP address>

Adding a user:

  1. Create a home dir: sudo mkdir /home/ftpuser
  2. Create the user account: sudo useradd -d /home/ftpuser
  3. Set the users passwd: sudo passwd ftpuser
  4. Change owner of the dir: sudo chown ftpuser /home/ftpuser
  5. Add the user to the allowed ftp user list: sudo vi /etc/vsftpd.userlist
  6. VSFTPD doesn’t allow writable root by default so change the permissions on the user root: sudo chown u-w /home/ftpuser