- Product Bulletin
- Service Overview
-
User Guide
- Usage Overview
- Selecting HCE as the Public Image When Creating an ECS
- Changing an OS to HCE
- Migrating an OS
- Upgrading HCE and RPM Packages
- Security Updates for HCE
- Obtaining the openEuler Extended Software Packages
- Creating a Docker Image and Starting a Container
- Tools
- Kernel Functions and Interfaces
- xGPU
- Configuring the Repositories and Installing Software for HCE
-
FAQs
- What Do I Do If CentOS Linux Is No Longer Maintained?
- Does Huawei Cloud Have a Migration Solution for CentOS?
- How Do I Install the MLNX Driver?
- How Do I Enable SELinux on an ECS Running HCE?
- How Do I Change the OS Name on the Console After the OS Is Migrated?
- How Are Huawei Cloud EulerOS, EulerOS, and openEuler Different from One Another?
- How Do I Enable WireGuard in Kernel and Install wireguard-tools?
- How Do I Save the User Credential Information for Logging In to Docker Like What Docker CE Does?
- What Is OOM? Why Does OOM Occur?
- How Do I Handle IPVS Errors?
- Why Can't HCE Obtain an IPv6 Address After IPv6 Is Enabled for an ECS?
- How Do I Set Auto Log Using TMOUT?
- Best Practices
- General Reference
Show all
Copied.
Setting Up an FTP Site
Introduction
vsftpd (very secure FTP daemon), is an FTP server for Unix-like systems, including Linux. This tutorial describes how you can deploy vsftpd in HCE 2.0.
Preparations
- Prepare an ECS and assign a public IP address or EIP to the ECS.
- Ensure that inbound security group rules allow traffic to flow to the ECS over port 21.
Procedure
- Install vsftpd and start it.
- Run the following command to install vsftpd:
dnf install vsftpd
- Run the following command to start vsftpd:
systemctl start vsftpd
- Run the following command to check the vsftpd status:
systemctl status vsftpd
If active (running) is displayed, vsftpd is started.
NOTE:
To set vsftpd to automatically enable upon system boot, run the following command:
systemctl enable vsftpd
- Run the following command to install vsftpd:
- Add a user for the FTP service.
- Run the following command to create a user for the FTP service:
adduser ftp
- Run the following command to set a password of the created user:
passwd ftp
- Run the following command to create a user for the FTP service:
- Configure vsftpd.
- Run the following commands to create directories and files for the FTP service (you can change the directories as required):
mkdir -p /data/ftp/ touch /data/ftp/test.txt
- Run the following command to set the created user as the owner of the directories:
chown -R ftp:ftp /data/ftp/
- Open the /etc/vsftpd/vsftpd.conf file and set the following parameters:
# Listen to IPv4 sockets. listen=YES # Determine whether to configure IPv6 listening. listen_ipv6=YES # Add the following parameters to the end of the configuration file: # Set the directory where the local user resides after login. local_root=/data/ftp/hce # Restrict all users to the home directory. chroot_local_user=YES # Enable the passive mode. pasv_enable=YES pasv_address=<Public IP address of the FTP server> chroot_list_enable=NO # Determine whether to allow users to access other directories. # If chroot_list_enable is set to YES, you need to set chroot_list_file to a file that contains the users who can access other directories. # chroot_list_file=/etc/vsftpd/chroot_list # Set the port range that can be used in passive mode. Set a large port range to improve the security of accessing the FTP server. # Minimum port in the available port range pasv_min_port=<port number> # Maximum port in the available port range pasv_max_port=<port number>
NOTE:
Retain the default values for other parameters.
CAUTION:
The /etc/vsftpd/chroot_list file must be created regardless of whether chroot_list_enable is configured.
- Run the following command to restart vsftpd:
systemctl restart vsftpd
- Run the following commands to create directories and files for the FTP service (you can change the directories as required):
- Verify vsftpd.
- Run the following command to check the port used by vsftpd:
netstat -natp | grep vsftpd
By default, port 21 is used.
- Configure inbound security group rules to enable port 21 and ports 5000 to 5010.
- In the Windows file manager, enter ftp://<Public IP address of the FTP server>:21 to access the FTP service. Enter the password, as shown in the following figure.
CAUTION:
If the following error occurs, add allow_writeable_chroot=YES to the end of the /etc/vsftpd/vsftpd.conf file and restart vsftpd:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
- Run the following command to check the port used by vsftpd:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot