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:
- Add IIS and FTP service roles.
- Create a username and password.
- Assign permissions to shared files.
- Add and set the FTP site.
- (Optional) Configure the FTP firewall.
- Set the security group and firewall.
- Verify the configuration on the client.
Procedure
- Add IIS and FTP service roles.
- Log in to the ECS.
- Choose Start > Server Manager.
- Click Add roles and features.
- In the Before you begin dialog box, click Next.
- Select Role-based or feature-based installation and click Next.
- Select the ECS where FTP is to be deployed and click Next.
- Select Web Server (IIS). In the dialog box that is displayed, click Add Features and then Next.
- Click Next until the Role Service page is displayed.
- Select FTP Server and IIS Management Console. Then, click Next.
- Click Install to assign the service roles.
- After the installation is complete, click Close.
- 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.
- In Server Manager, choose Dashboard > Tools > Computer Manager.
- Choose System Tools > Local Users and Groups > Users, right-click the blank area on the right, and choose New User from the shortcut menu.
- Set User name (ftpadmin is used as an example) and Password.
- Assign permissions to shared files.
Set access and edit permissions for the files shared to users on the FTP site.
- 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.
- On the Security tab, select Everyone and click Edit.
If Everyone is unavailable, add it. For details, see FAQs.
- Select Everyone, assign permissions as needed, and click OK.
In this example, all permissions are allowed.
- Create a folder for FTP on the ECS, right-click the folder, and choose Properties from the shortcut menu.
- Add and set the FTP site.
- In Server Manager, choose Dashboard > Tools > Internet Information Services (IIS) Manager.
- Right-click Sites and choose Add FTP Site from the shortcut menu.
- 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.
- 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.
NOTE:
When Allow SSL and Require SSL are selected, select an existing SSL certificate or create one. For details, see 3.
- 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.
- Allow access to:
- Authentication
- 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.
- (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.云服务器一般都有公网IP,如果需要通过公网IP来访问FTP服务,则需要配置防火墙启用Passive Connection. (即便服务器上防火墙关闭也需要配置并重启服务器生效)
- Double-click FTP Firewall Support.
- 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.
- Restart the ECS for the firewall configuration to take effect.
- Set the security group and firewall.
云服务器安全组策略,添加一条入站规则,允许上述Passive端口。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.
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
- 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.
NOTE:
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
- For more information about setting up an FTP site on a Windows ECS, see Microsoft official documents.
- When configuring the properties of a folder, if Everyone is unavailable, perform the following operations to add it:
- On the Security tab, click Edit.
- In the dialog box that is displayed, click Add.
- In the dialog box that is displayed, click Advanced.
- In the dialog box that is displayed, click Find Now, select Everyone in search results, and click OK.
- Click OK to return to the permissions page.
- Click OK.
- Create a server certificate.
- In Server Manager, choose Dashboard > Tools > Internet Information Services (IIS) Manager.
- In the list on the left, click the server. Under IIS, double-click Server Certificates. The Server Certificates page is displayed.
- Click Create Self-Signed Certificate.
- Specify a certificate name, select a certificate storage type, and click OK.
The created certificate is displayed on the Server Certificates page.
From: Setting Up an FTP Site (Windows)_Elastic Cloud Server (huaweicloud.com)