CentOS FTP Server 兼容性问题排查与解决
一 基础兼容性与连通性检查
systemctl status vsftpd、systemctl enable vsftpd --now。ping、telnet 服务器IP 21/990,必要时用 traceroute 定位网络路径问题。journalctl -xeu vsftpd 的输出。二 防火墙与 SELinux 的正确放行
firewall-cmd --permanent --add-port=21/tcpfirewall-cmd --permanent --add-port=990/tcpfirewall-cmd --permanent --add-port=10060-10070/tcpfirewall-cmd --reloadsetsebool -P ftp_home_dir onsetsebool -P allow_ftpd_full_access onsetenforce 0 验证,但务必恢复为 Enforcing 并采用精确布尔值。三 vsftpd 关键配置与客户端兼容要点
anonymous_enable=NO(禁用匿名)local_enable=YES、write_enable=YES(允许本地用户与写入)chroot_local_user=YES(限制用户在主目录)allow_writeable_chroot=YES 以避免 “refusing to run with writable root inside chroot()”。pasv_enable=YESpasv_min_port=10060、pasv_max_port=10070(示例范围,需在防火墙放行)/etc/pam.d/vsftpd、/etc/vsftpd/user_list、/etc/vsftpd/ftpusers。四 快速排查清单与推荐配置
anonymous_enable=NOlocal_enable=YES、write_enable=YES、local_umask=022chroot_local_user=YES、allow_writeable_chroot=YESpasv_enable=YES、pasv_min_port=10060、pasv_max_port=1007021/tcp、990/tcp(仅 FTPS)、10060-10070/tcp;SELinux:ftp_home_dir、allow_ftpd_full_access 设为 on。