代码改变世界

vsftpd连接时报530 Login incorrect

2017-01-17 20:57  wzpcss  阅读(453)  评论(0编辑  收藏  举报

今天想测试下两台机器直接传输速率,客户端是windows,服务端是Ubuntu。使用ftp连接时,日志输出如下:

连接到 192.168.1.1。
220 (vsFTPd 2.2.2)
用户(192.168.1.1:(none)): test
331 Please specify the password.
密码:
530 Login incorrect.
登录失败。

网上找了好多办法,最终总结从以下步骤来解决问题:

1,使用service vsftpd status命令查看vsftpd服务在不在

2,只需要把/etc/pam.d/vsftpd文件中的auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed注释掉,在前面加个#即可,

3,修改完配置文件后重启服务。

/etc/pam.d/vsftpd里面配置内容如下:

# Standard behaviour for ftpd(8).

#auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed

# Note: vsftpd handles anonymous logins on its own. Do not enable pam_ftp.so.

# Standard pam includes
@include common-account
@include common-session
@include common-auth
auth required pam_shells.so

如果无法传输文件,则需要修改 /etc/vsftpd.conf  将local_enable=YES(26行左右)和write_enable=YES(29行左右)前面注释去掉(vi可以使用set nu设置行号)。