Huawei Cloud EulerOS
Huawei Cloud EulerOS
- 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
On this page
Show all
Copied.
Deploying the SFTP Service
Introduction
Secure File Transfer Protocol (SFTP) is a file transfer protocol that leverages a set of utilities that provide secure access to a remote computer to deliver secure communications. It is considered by many to be the optimal method for secure file transfer. It leverages SSH and provides security and identity authentication functions of SSH. This tutorial describes how you can deploy the SFTP service 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 22.
Procedure
- Configure the SFTP service.
- Run the following command to create a user group named sftp:
groupadd sftp
- Run the following command to create a user for accessing the SFTP service:
useradd -g sftp -s /bin/false usftp
- Run the following command to set a password of the created user:
passwd usftp
- Run the following command to create a home directory for the sftp user group:
mkdir -p /data/sftp/usftp
- Run the following command to change the login directory of the usftp user:
usermod -d /data/sftp/usftp usftp
- Open the /etc/ssh/sshd_config file and set the following parameters:
Subsystem sftp internal-sftp # Append the following content to the end of the file: Match user usftp # Match the usftp user. AllowTcpForwarding no # TCP forwarding is not allowed. X11Forwarding no # X11 forwarding is not allowed. # Use chroot to specify /data/sftp/%u as the root directory of the user. %u indicates the user name. ChrootDirectory /data/sftp/ ForceCommand internal-sftp # Forcibly execute internal-sftp.
- Run the following command to create a test file:
touch /data/sftp/usftp/test.txt
- Run the following commands to set the directory permission:
chown -R usftp:sftp /data/sftp/usftp chmod 755 /data/sftp/usftp
- Run the following command to create a user group named sftp:
- Verify the SFTP service.
- On the other host, run the following command to connect to the SFTP service:
sftp usftp@<Public IP address of the SFTP service>
- Enter the password and run the ls command to view the test file.
sftp> ls test.txt
- On the other host, run the following command to connect to the SFTP service:
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot