Setting up FTP Server on Ubuntu – Amazon EC2

September 5, 2011 · Posted in Development 

File Transfer Protocol (FTP) is a TCP protocol for uploading and downloading files between computers.

Amazon EC2 instance comes without FTP server installed. So you have to install it manually.

Amazon EC2: Unblock FTP port

FTP works on port 21 by default. By default this port is blocked by the AWS firewall. You must unblock this port (21) by changing the instance permissions prior to setting up FTP so that you can access FTP remotely. This can be done using the AWS Management Console.

Go to Security Groups, select the group associated with your instance.

Add TCP rule with port 21.

 

Install and Configure FTP server – vsftpd

vsftpd is an FTP daemon available in Ubuntu. It is easy to install and set up it. To install vsftpd run the following command:

sudo apt-get install vsftpd

 

Edit vsftp configuration file (usually located at /etc/vsftpd.conf).

 

Disable anonymous access:

anonymous_enable=NO

Enable local access:

By default, local system users are not allowed to login to FTP server. To change this setting, you should uncomment the following line:

local_enable=YES

Enable writing:

By default, users are allowed to download files from FTP server. They are not allowed to upload files to FTP server. To change this setting, you should uncomment the following line:

write_enable=YES

 

Chown user:

chown_uploads=YES

chown_username=your user name (! not root)

 

After you finish configuring FTP server you need to restart it:

sudo service vsftpd restart

 

 

References:

* http://curiousdeveloper.blogspot.com/2008/07/setting-up-ftp-server-on-ubuntu-amazon.html

http://ubuntuforums.org/showthread.php?t=91887

Comments

  • Claudesutterlin

    Old article but one of the top search results so, here’s a tip.

    If you’re using FileZilla to connect and getting “Failed to retrieve directory listing” change your Transer Mode to Active in the connection properties.

  • http://id.linkedin.com/in/rizky Rizky Syazuli

    and how do you setup individual FTP user accounts?

  • Alex Laughnan

    Did you solve this Rizky?

  • http://id.linkedin.com/in/rizky Rizky Syazuli

    nope. not yet. let me know if you find anything useful.

  • Wawa

    Why don’t you use SFTP with the .pem file?

  • Ryan Coleman

    Wouldn’t you set up a new local user? Or is there something else that’s blocking it out?

    I’m trying to do this right now with proftpd.

  • Ryan Coleman

    Yeah, that worked for me… set up the user, open the port forward (I’m using 8021) and restart the service.

    I am having the same issue with directory listings.

  • http://id.linkedin.com/in/rizky Rizky Syazuli

    didn’t think of that. i thought the system and ftp user was two different thing.

    okay then. will do that. thx!