linux vsftpd 用户验证慢

2015-11-26 17:37:31 +08:00
 mathcoder23

输入正确的用户名和密码,这个响应确实比较快,
但是为什么输入不正确的用户和密码,这个响应不是一般的慢,这是其一。
其二:
禁止了匿名用户登录,但是我任性的匿名登录一下(响应太慢了,过很久才返回 530 Login incorrect)这不是我想要的,我想它很快的返回 530 Login incorrect 。
至于为什么要这样任性的登录是因为 win 资源管理器访问 ftp 服务器它就会先尝试匿名登录,但服务器验证了很久才返回错误消息,所以导致在 win 资源管理器输入 ftp 地址,过了很久才出现登录用户的提示框。
vsftpd 快速认证,怎么破?

2854 次点击
所在节点    Linux
4 条回复
kmahyyg
2015-11-26 17:45:51 +08:00
unix auth =yes
permit root login 随意
NOanonymous = on
yov123456
2015-11-26 19:52:48 +08:00
mathcoder23
2015-11-27 11:11:21 +08:00
@yov123456 谢谢这个对我非常有帮助,问题和我上个问题很类似,
I experienced a similar issue recently. When I was using Internet Explorer 11 to access an FTP URL, such as ftp://ftp.hostname.com, it would not prompt for a username and password. If I used Firefox it worked fine. I figured out the issue in my case. Since I set the vsftpd setting userlist_deny=NO, the file user_list (/etc/vsftpd/user_list) became a file containing a list of users that are allowed to connect to the server. An entry for user "anonymous" had to exist in there for some browsers to work properly, such as Internet Explorer 11. I had to do that even though I don't allow anonymous access by setting anonymous_enable=NO.
The reason is the following. When you use a web browser to connect to an FTP URL, such as ftp://ftp.hostname.com, it will first try to automatically connect as user anonymous. If that user is not explicitly authorized to connect to the vsftpd, which is needed when using userlist_deny=NO, the browser will get a permission denied response. Some browsers don't handle this well, such as Internet Explorer 11. That browser stopped trying to connect immediately so it didn't ask me for a username and password. Once I added user anonymous to the authorized list, instead of the browser receiving a permission denied response it received a response asking for the password of user anonymous. Once the browser couldn't log on automatically as user anonymous it prompted me for a username and password.
我按照这位大神的做法确实,在认证过程中,传输了用户名后,服务器就直接返回 530 permission denied ,不进行用户名和密码认证,这确实响应速度加快了,因为耗时操作是在提交了用户名和密码后嘛,但现在问题又来了,在浏览器可以比较快速的弹出登陆框了,但如果是资源管理器,它发现服务器响应的 permission denied 居然是认为访问路径的权限不够,直接弹出了一个错误的提示框,而不是登陆界面.现在问题的一步步解决了,还差一点点就成功了.
mathcoder23
2015-11-27 11:11:48 +08:00
@kmahyyg 你好,我不是很懂你意思,可以更详细一点吗?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/239176

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX