How to solve the problems encountered when installing vsftpd in nginx

WBOY
Release: 2023-05-18 08:40:05
forward
649 people have browsed it

The simplest installation steps

[root@itdragon ~]# useradd ftpuser
[root@itdragon ~]# passwd ftpuser
changing password for user ftpuser.
new password: 
bad password: it is too short
bad password: is too simple
retype new password: 
passwd: all authentication tokens updated successfully.
[root@itdragon ~]# yum -y install vsftpd
[root@itdragon ~]# ifconfig
Copy after login

Step 1: Add ftp user
Step 2: Set ftp user password
Step 3: Install vsftpd
Step 4: Check the IP address
Step 5: Use free filezilla locally to link to the virtual machine

Problems encountered

Connection failed

状态: 正在等待重试...
状态: 正在连接 192.168.0.11:21...
错误: 20 秒后无活动,连接超时
错误: 无法连接到服务器
Copy after login

Don’t be discouraged. Installation is not always smooth sailing. Everyone will have different problems based on their own environment. The following is my solution

First of all, make sure that both sides can ping. The virtual machine has selected the bridge mode and can ping normally.

Then, Baidu

There are many various solutions on the Internet, mainly for three aspects

I will post them here Several URLs, because I failed to connect successfully according to the instructions on the website, and finally solved it by turning off the firewall. I am relatively weak in this area, so I won’t mislead others. Posted here to facilitate future modifications.

The first operation is to turn off anonymity and enable passive mode

The second operation is to open port 21 of the firewall

The third operation The first operation is to modify selinux and enable external network access

[root@itdragon ~]# vim /etc/vsftpd/vsftpd.conf
anonymous_enable=no
pasv_min_port=30000
pasv_max_port=31000
[root@itdragon ~]# service vsftpd restart
[root@itdragon ~]# vim /etc/sysconfig/iptables
-a input -p tcp -m multiport --dport 20,21 -m state --state new -j accept
-a input -p tcp -m state --state new -m tcp --dport 21 -j accept
-a input -p tcp --dport 30000:31000 -j accept
[root@itdragon ~]# service iptables restart
[root@itdragon ~]# getsebool -a | grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> off
ftpd_connect_db --> off
ftpd_use_fusefs --> off
ftpd_use_passive_mode --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
tftp_use_cifs --> off
tftp_use_nfs --> off
[root@itdragon ~]# setsebool -p allow_ftpd_full_access on
[root@itdragon ~]# setsebool -p ftp_home_dir on
Copy after login

Temporarily turning off the firewall is not enough, just turn off the firewall permanently

[root@itdragon modprobe.d]# service iptables stop
iptables: setting chains to policy accept: filter     [ ok ]
iptables: flushing firewall rules:             [ ok ]
iptables: unloading modules:                [ ok ]
[root@itdragon modprobe.d]# chkconfig iptables off
Copy after login

Upload failed

In An images folder was created in the nginx installation directory. When uploading images through filezilla, an error message appears.

响应:553 could not create file.
错误: 严重文件传输错误
Copy after login

The solution is as follows

[root@itdragon html]# mkdir images
[root@itdragon html]# chmod -r 777 images
[root@itdragon html]# ll
total 12
-rw-r--r--. 1 root root 537 nov 18 10:53 50x.html
drwxrwxrwx. 2 root root 4096 nov 18 10:55 images
-rw-r--r--. 1 root root 612 nov 18 10:53 index.html
[root@itdragon html]# vim /etc/vsftpd/vsftpd.conf 
local_root=/var/ftp
[root@itdragon html]# service vsftpd restart
Copy after login

Notes

The network must be able to ping.

Firewall issues must be dealt with

Cannot create file issues

The above is the detailed content of How to solve the problems encountered when installing vsftpd in nginx. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!