Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Setting Up an FTP Site (Huawei Cloud EulerOS 2.0)

Updated on 2024-10-16 GMT+08:00

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

  1. Install vsftpd and start it.

    1. Run the following command to install vsftpd:
      dnf install vsftpd
    2. Run the following command to start vsftpd:
      systemctl start vsftpd
    3. 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

  2. Add a user for the FTP service.

    1. Run the following command to create a user for the FTP service:
      adduser ftp
    2. Run the following command to set a password of the created user:
      passwd ftp

  3. Configure vsftpd.

    1. 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
    2. Run the following command to set the created user as the owner of the directories:
      chown -R ftp:ftp /data/ftp/
    3. 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.

    4. Run the following command to restart vsftpd:
      systemctl restart vsftpd

  4. Verify vsftpd.

    1. Run the following command to check the port used by vsftpd:
      netstat -natp | grep vsftpd

      By default, port 21 is used.

    2. Configure inbound security group rules to enable port 21 and ports 5000 to 5010.
    3. 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()

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback