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:
[codesyntax lang=”bash”]
sudo apt-get install vsftpd
[/codesyntax]
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:
[codesyntax lang=”bash”]
sudo service vsftpd restart
[/codesyntax]
References:
* http://curiousdeveloper.blogspot.com/2008/07/setting-up-ftp-server-on-ubuntu-amazon.html
Claudesutterlin says:
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.
Rizky Syazuli says:
and how do you setup individual FTP user accounts?
Alex Laughnan says:
Did you solve this Rizky?
Rizky Syazuli says:
nope. not yet. let me know if you find anything useful.
Ryan Coleman says:
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 says:
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.
Rizky Syazuli says:
didn’t think of that. i thought the system and ftp user was two different thing.
okay then. will do that. thx!
Wawa says:
Why don’t you use SFTP with the .pem file?