Lately, I had a need to use the said cloud platform for my data storage being thrown via FTP. It wasn't that easy so I thought of having a step by step guide of doing it.
Therefore, in this post, I'll list the steps of setting up an Ubuntu FTP server inside Microsoft Azure.
Steps on Setting Up
- Installing Ubuntu 12.04 in Microsoft Azure
Please make sure that you are logged in to your Azure account for the following steps.
- Click on Virtual Machine and then click New
- Click on Quick Create and choose your settings. For this tutorial, I'll be using Ubuntu 12.04 for the image (OS)
- Once done, click the Virtual Machine you just created and check Endpoints.
Here you can open ports for public use. By default, port 22 used by SSH is open. Now let us open port 21 too for FTP.
Make sure to set private port to 21 since this is the port that we will be using though you can use (advisable but not required) to use a different port number for the public port.
Upon opening the said ports, We can now proceed with installing VSFTPD via SSH.
Login to your SSH using your client of choice (I prefer to use PuTTY when in windows and just plain Terminal when in Linux machine) and install proceed with installation
- On your terminal, type:
sudo apt-get install vsftpd
- Once done, edit the configuration of vsftpd (I prefer to use
vi
, but you can use any text editor you want such asnano
):
sudo vi /etc/vsftpd.conf
- Find and set anonymous_enabled to NO to avoid anonymous access.
anonymous_enabled=NO
Also uncomment local_enable and write_enable to allow logging in of local users and enable them write on the directories, respectively
local_enable=YES write_enable=YES
- Also add the following on the config file:
pasv_enable=YES pasv_address=[Your public address] pasv_min_port=12000 pasv_max_port=12003
Your address might be the DNS of your virtual machine or the public IP address. See Virtual Machine on azure and click dashboard to see these details.
Thispasv_options
are important when you want to access your box outside via passive FTP. Not doing so may result on the following errors:
Command: LIST Error: Connection timed out Error: Failed to retrieve directory listing
- Save the configuration by clickng ESC button then type
:wq
- Type
sudo service vsftpd restart
to restart the VSFTPD.
- On your terminal, type:
- Now since we used pasv_min_port and pasv_max_port, we also need to open ports 12000 to 12003 in the endpoints. Refer to step 2 regarding this.
After doing this, you may want to check your FTP now via your favorite client such as FileZilla or FireFTP extension.
No comments :
Post a Comment