Help Center> Elastic Cloud Server> Best Practices> Setting Up an FTP Site (Windows)
Updated at: 2022-02-26 GMT+08:00

Setting Up an FTP Site (Windows)

Overview

The best practices for ECS guide you through the setup of an FTP site on a Windows ECS. The Windows Server 2012 R2 OS is used as an example in this section.

The process is as follows:

  1. Add IIS and FTP service roles.
  2. Create a username and password.
  3. Assign permissions to shared files.
  4. Add and set the FTP site.
  5. (Optional) Configure the FTP firewall.
  6. Set the security group and firewall.
  7. Verify the configuration on the client.

Procedure

  1. Add IIS and FTP service roles.

    1. Log in to the ECS.
    2. Choose Start > Server Manager.
    3. Click Add roles and features.

    4. In the Before you begin dialog box, click Next.
    5. Select Role-based or feature-based installation and click Next.

    6. Select the ECS where FTP is to be deployed and click Next.

    7. Select Web Server (IIS). In the dialog box that is displayed, click Add Features and then Next.

    8. Click Next until the Role Service page is displayed.
    9. Select FTP Server and IIS Management Console. Then, click Next.

    10. Click Install to assign the service roles.
    11. After the installation is complete, click Close.

  2. Create a username and password.

    The Windows username and password are used for FTP. If you allow anonymous users to access FTP, you do not need to create an FTP username and password.

    1. In Server Manager, choose Dashboard > Tools > Computer Manager.

    2. Choose System Tools > Local Users and Groups > Users, right-click the blank area on the right, and choose New User from the shortcut menu.

    3. Set User name (ftpadmin is used as an example) and Password.

  3. Assign permissions to shared files.

    Set access and edit permissions for the files shared to users on the FTP site.

    1. Create a folder for FTP on the ECS, right-click the folder, and choose Properties from the shortcut menu.

      The work01 folder is used as an example.

    2. On the Security tab, select Everyone and click Edit.

      If Everyone is unavailable, add it. For details, see FAQs.

    3. Select Everyone, assign permissions as needed, and click OK.

      In this example, all permissions are allowed.

  4. Add and set the FTP site.

    1. In Server Manager, choose Dashboard > Tools > Internet Information Services (IIS) Manager.

    2. Right-click Sites and choose Add FTP Site from the shortcut menu.

    3. In the dialog box that is displayed, set the FTP site name and the physical path in which the shared folder is stored. Then, click Next.

      Site name FTPSERVER is used as an example.

    4. Enter the private IP address and port number of the ECS, set SSL, and click Next.
      • The default port number is 21. You can set the port number as required.
      • Set SSL as required.
        • No SSL: SSL encryption is not required.
        • Allow SSL: allows non-SSL and SSL connections between the FTP server and the client.
        • Required SSL: SSL encryption is required for the communication between the FTP server and the client.

          When Allow SSL and Require SSL are selected, select an existing SSL certificate or create one. For details, see 3.

    5. Configure authentication and authorization and click Finish.
      • Authentication
        • Anonymous: allows any user with username anonymous or ftp to access.
        • Basic: allows only users with authorized usernames and passwords to access. However, the passwords transmitted over the network are not encrypted. Therefore, you are advised to use this authentication method after confirming that the network connection between the client and the FTP server is secure.
      • Authorization
        • Allow access to:
          • All users: All users are allowed.
          • Anonymous users: Anonymous users are allowed.
          • Specified roles or user groups: Only specified roles or user group members are allowed. If you select this option, you are required to enter the specified roles or user group in the text box.
          • Specified users: Only specified users are allowed. If you select this option, you are required to enter the specified users in the text box.
        • Permissions: specifies permissions for the authorized users.

    6. Add the private IP address of the ECS to the FTP site.

      Choose Sites, select the FTP site, and click Bindings. In the Site Bindings dialog box, click Add. Then, add the private IP address of the ECS in the displayed dialog box add click OK.

  5. (Optional) Configure the FTP firewall.

    • To enable the passive mode on the FTP server, configure the FTP firewall.
    • If HUAWEI CLOUD servers use public IP addresses to access the FTP site that is set up on a HUAWEI CLOUD ECS, the passive mode must be enabled on the FTP server.
    1. Double-click FTP Firewall Support.

    2. Set parameters and click Apply.
      • Data Channel Port Range: specifies the range of ports used for passive connections. The port range is 1025-65535. Configure this parameter based on site requirements.
      • External IP Address of Firewall: Enter the public IP address of the ECS.

    3. Restart the ECS for the firewall configuration to take effect.

  6. Set the security group and firewall.

    After setting up the FTP site, add a rule in the inbound direction of the security group to allow packets to pass through the FTP port. For details, see Configuring Security Group Rules. For details about the ports on which to allow packets, see Table 1.

    If FTP Firewall Support is configured, enable the ports used by the FTP site and the data channel ports used by the FTP firewall in the security group.

    By default, the firewall allows packets to pass through TCP port 21 for FTP. If another port is used, add an inbound rule that allows packets to pass through the port on the firewall.

    Table 1 Security group rules

    FTP Mode

    Direction

    Protocol

    Port

    Source

    Active

    Inbound

    TCP

    Ports 20 and 21

    0.0.0.0/0

    Passive

    Inbound

    TCP

    Port 21, and port range from 1024 to 65535 (such as 5000-6000)

    0.0.0.0/0

  7. Verify the configuration on the client.

    On the computer with the client installed, enter fttp://IP address of the FTP server:FTP port number in the Internet Explorer address bar. If you do not specify the port number, default port number 21 is used. If a dialog box is displayed for you to enter the username and password, the configuration is correct. After entering the username and password, you can perform operations on the FTP folder with assigned permissions.

    If FTP Firewall Support is not configured, configure the Internet Explorer browser. Otherwise, the FTP folder will be inaccessible. To configure the Internet Explorer browser, choose Tools > Internet Options > Advanced, select Enable FTP folder view, and deselect Use Passive FTP.

FAQs

  1. For more information about setting up an FTP site on a Windows ECS, see Microsoft official documents.
  2. When configuring the properties of a folder, if Everyone is unavailable, perform the following operations to add it:
    1. On the Security tab, click Edit.

    2. In the dialog box that is displayed, click Add.

    3. In the dialog box that is displayed, click Advanced.

    4. In the dialog box that is displayed, click Find Now, select Everyone in search results, and click OK.

    5. Click OK to return to the permissions page.
    6. Click OK.
  3. Create a server certificate.
    1. In Server Manager, choose Dashboard > Tools > Internet Information Services (IIS) Manager.

    2. In the list on the left, click the server. Under IIS, double-click Server Certificates. The Server Certificates page is displayed.

    3. Click Create Self-Signed Certificate.

    4. Specify a certificate name, select a certificate storage type, and click OK.

      The created certificate is displayed on the Server Certificates page.

close