Azure is a cloud platform provided by Microsoft. With this, you can create a Virtual Machine that can be used as a server for sending and accepting files.

Microsoft Azure

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

  1. Installing Ubuntu 12.04 in Microsoft Azure
    Please make sure that you are logged in to your Azure account for the following steps.

    1. Click on Virtual Machine and then click New
    2. Click on Quick Create and choose your settings. For this tutorial, I'll be using Ubuntu 12.04 for the image (OS)
    Virtual Machine Microsoft Azure

  2. 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.

  3. 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

    1. On your terminal, type:

      sudo apt-get install vsftpd
    2. Once done, edit the configuration of vsftpd (I prefer to use vi, but you can use any text editor you want such as nano):

      sudo vi /etc/vsftpd.conf
    3. 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
    4. 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.

      This pasv_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
      
    5. Save the configuration by clickng ESC button then type :wq
    6. Type sudo service vsftpd restart to restart the VSFTPD.
  4. 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