Configure vsftpd in Alibaba Cloud "VPC" network type

Original address: Portal

 

Environment: Cloud server ECS, network type is "VPC", create ECS and bind public IP; system image is Debian 8 
 
Symptom: The FTP client can connect to the FTP server, but "Failed to read the directory list". 
 
 
 
 
 
 
Cause: The ECS system on the private network does not have a public IP address. It is connected to the Internet through NAT, and the default security group rule during the creation of the ECS does not have a shortcut option for FTP. It is recommended to use sftp protocol instead of ftp in Linux system. 
 
 
 
 
 
 
 
 
 
 
Procedure: 
 
1. apt-get install  vsftpd Install vsftpd 
 
 
 
 
 
2. vi /etc/vsftpd.conf Edit the vsftpd configuration file, modify or add the following configuration content: 
 
 
 

  1. listen=YES # listen on default port 21
  2.     write_enable=YES # Write permission
  3.     pasv_enable=YES # Enable pasv mode
  4.     pasv_min_port=30000 # Set the available port range in pasv mode (start)
  5.     pasv_max_port=30100 # Set the available port range in pasv mode (end)
  6.     pasv_address=39.108.4.89 # Set the external IP in pasv mode
  7.     seccomp_sandbox=NO # Disable seccomp function

 
 
 
3. In the ECS instance security group, add two rules to allow the corresponding tcp port access (tcp 21 port, and tcp 3000 to 30100 ports) 
 
 
 
 
 
 
 
 
 
 
 
4. In the FileZilla Client test, the files can be successfully listed and uploaded for 
 
 
 
 
 
reference : 
https://askubuntu.com/questions/592577/vsftpd-pasv-configuration-set-up-yet-still-not-working 
https://serverfault.com/questions/421161/how-to-configure- vsftpd-to-work-with-passive-mode 
http://worldend.logdown.com/posts/247495-solve-vsftpd-500-oopspriv-sock-get-cmd

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325649974&siteId=291194637