一则VSFTPD非本机连接慢问题排查与处理

问题描述:
测试环境一FTP,用户反馈连接登陆很慢,有些甚至连接不上。

说明:

ftp服务器使用的是vsftpd。 操作系统为centos7.4 。

分析与测试:
1. 首先在FTP本机进行了测试,并排查了FTP服务器防火墙,selinux问题(均无问题)。
2. ftp本机登陆很快,别的机器(同网段)访问很慢。
3. 办公网的window访问,连接不上,网络是OK的(telnet,防火墙都是没问题的)

抓包:
抓包发现,其实是已经登陆了的,账号密码也没问题,但是登陆成功之后,不知道为什么隔了20s才登陆成功。

filezilla 客户端默认20s没有活动,所以断开了连接。

网上查询vsftpd连接慢的问题后,发现有人提出reverse_lookup_enable参数可能会出现较大的延迟。关于该数的man信息如下:

reverse_lookup_enable
Set to YES if you want vsftpd to transform the ip address into the hostname, before pam authentication. This is useful if you use pam_access
including the hostname. If you want vsftpd to run on the environment where the reverse lookup for some hostname is available and the name server
doesn’t respond for a while, you should set this to NO to avoid a performance issue.
Default: YES

既然默认是YES,而且是其会尝试反解析,这里就修改下,在/etc/vsftpd/vsftpd.conf文件中增加

reverse_lookup_enable=NO

并重启vsftpd服务后,问题解决。

这个只是一个个例,不代表所有登陆慢或者连接不上都是这个原因,仅供参考测试。

posted @ 2020-01-04 21:07  xuege  阅读(779)  评论(0编辑  收藏  举报