VSFTPD安装方法如下:
//安装 vsftpd
[root@aerchi ~]# yum -y install vsfptd
...
Total 3.6 MB/s | 180 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : vsftpd-3.0.3-31.el8.x86_64 1/1
Running scriptlet: vsftpd-3.0.3-31.el8.x86_64 1/1
Verifying : vsftpd-3.0.3-31.el8.x86_64 1/1
Installed:
vsftpd-3.0.3-31.el8.x86_64
//vsftpd 自启动
[root@aerchi ~]# systemctl enable vsftpd.service
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
[root@aerchi ~]# service vsftpd start
Redirecting to /bin/systemctl start vsftpd.service
[root@aerchi ~]#
路径: /etc/pam.d/vsftpd
#%PAM-1.0
session optional pam_keyinit.so force revoke
#auth required pam_listfile.so item=user sense=d eny file=/etc/vsftpd/ftpusers onerr=succeed
#auth required pam_shells.so
#auth include password-auth
#account include password-auth
auth required /lib64/security/pam_userdb.so db= /etc/vsftpd/vftpuser
account required /lib64/security/pam_userdb.so db= /etc/vsftpd/vftpuser
session required pam_loginuid.so
session include password-auth
1. 如题, FTP上传时抛vftpuser.db: file size not a multiple of the pagesize 530 Login incorrect.
STATUS:> [2020-09-02 20:51:47] Connected. Authenticating...
COMMAND:> [2020-09-02 20:51:47] USER root
[2020-09-02 20:51:47] 331 Please specify the password.
COMMAND:> [2020-09-02 20:51:47] PASS *****
[2020-09-02 20:51:48] BDB3037 /*/*/vftpuser.db: file size not a multiple of the pagesize
530 Login incorrect.
ERROR:> [2020-09-02 20:51:48] WARNING! Invalid FTP reply received: 3 digit number expected at the beginning of the server reply.
ERROR:> [2020-09-02 20:51:48] Not logged in.
ERROR:> [2020-09-02 20:51:48] Can't login. Disconnecting...
研究了好久,发现是 vftpuser.db文件有错。 解决办法:
1. 定位到vftpuser.db所在的父目录(如 cd /etc/aerchi/vftpuser.db), 使用 rm vftpuser.db 删除 vftpuser.db
[root@aerchivsftpd]# rm vftpuser.db
rm: remove regular file ‘vftpuser.db’? y
2. 使用 load_data 重新生成vftpuser.db
[root@aerchi vsftpd]# db_load -T -t hash -f /etc/aerchi/vftpuser.txt /etc/aerchi/vftpuser.db
[root@aerchi vsftpd]# ll
total 60
...
-rw-r--r-- 1 root root 12288 Sep 2 21:07 vftpuser.db
...
3. 重启ftp
service vsftpd restart
4. 再次连接, 正常。
COMMAND:> [2020-09-02 21:21:49] CWD /*/aerchi
[2020-09-02 21:21:49] 250 Directory successfully changed.
STATUS:> [2020-09-02 21:21:49] PWD skipped. Current folder: "/*/aerchi".
COMMAND:> [2020-09-02 21:21:49] PORT 192,168,2,101,221,209
[2020-09-02 21:21:49] 200 PORT command successful. Consider using PASV.
COMMAND:> [2020-09-02 21:21:49] LIST -a
[2020-09-02 21:21:49] 150 Here comes the directory listing.
[2020-09-02 21:21:49] 226 Directory send OK.
STATUS:> [2020-09-02 21:21:49] Directory listing completed
2. FTP登录时显示: vsftpd 530 login incorrect
查看 /etc/vsftpd/vsftpd.conf文件中的相关配置,
pam_service_name=vsftpd, 表明启用了pam.配置: 进入 vim/etc/pam.d/vsftpd , 修改如下
#%PAM-1.0
session optional pam_keyinit.so force revoke
#auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/f tpusers onerr=succeed
#auth required pam_shells.so
#auth include password-auth
#account include password-auth
auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/vftpuser
account required /lib64/security/pam_userdb.so db=/etc/vsftpd/vftpuser
session required pam_loginuid.so
session include password-auth
~
保存后, 再次重启 vsftpd. 用 cmd 测试:
OK, 成功了
3.另, 关于 Cute FTP登录后, 远程工作区目录看不到目录列表的解决方法.
解决办法: 站点管理器右击 属性 -> 站点属性窗口, 操作选项卡, -> 筛选器 (筛选器属性)-> 取消勾选 启用筛选
乐意黎原创 2020-09-02