vsftpd 在 CentOS 的常见错误代码与含义
| 代码/消息 | 含义 | 常见触发原因 | 快速排查 |
|---|---|---|---|
| 220 | 服务就绪 | 正常欢迎信息 | 无需处理 |
| 221 Goodbye | 服务关闭连接 | 正常断开 | 无需处理 |
| 230 Login successful | 登录成功 | 凭据正确、PAM放行 | 无需处理 |
| 331 Please specify the password | 需要密码 | 用户名正确 | 输入正确密码 |
| 530 Login incorrect / Not logged in | 登录失败 | 密码错误、PAM/用户列表限制、shell 不在 /etc/shells | 核对密码;检查 /etc/pam.d/vsftpd 与 /etc/vsftpd/ftpusers、/etc/vsftpd/user_list;必要时将用户的 shell(如 /sbin/nologin)加入 /etc/shells |
| 500 OOPS: cannot open user list file | 无法打开用户列表文件 | 文件不存在或路径错误 | 创建文件(如 /etc/vsftpd.user_list 或 /etc/vsftpd/chroot_list),并写入对应用户 |
| 500 OOPS: missing value in config file | 配置项缺少值 | 参数“=”后无值或格式错误 | 修正 vsftpd.conf 中对应行 |
| 500 OOPS: bad bool value in config file | 布尔值非法 | 如“YES/NO”写错、拼写错误 | 改为正确的 YES/NO |
| 500 OOPS: unrecognised variable in config file | 未知配置项 | 参数名拼写错误或前导空格 | 删除多余空格、纠正参数名 |
| 500 OOPS: vsftpd: refusing to run with writable root inside chroot () | chroot 根目录可写 | 启用 chroot 且家目录可写(vsftpd ≥ 2.3.5 的安全限制) | 方案A:chmod a-w /home/用户名;方案B:在 vsftpd.conf 中设置 allow_writeable_chroot=YES |
| 500 OOPS: chdir / 500 OOPS: child died | 切换目录失败 | 主目录不存在、权限不足、父目录不可执行 | 确认主目录存在并赋权(如 chmod 755 /home/用户名),检查父目录权限 |
| 500 OOPS: tcp_wrappers is set to YES but no tcp wrapper support compiled in | 编译时未包含 TCP Wrappers | 配置启用但二进制不支持 | 在 vsftpd.conf 中将 tcp_wrappers=NO |
| 500 Illegal PORT command | 主动模式端口非法 | 客户端使用的高位端口被防火墙阻断 | 改用被动模式(PASV),或开放服务器侧数据端口范围 |
| 425 Failed to establish connection | 数据连接建立失败 | 被动端口未放行、NAT/云安全组未放通 | 配置 pasv_enable=YES; pasv_min_port=10060; pasv_max_port=10070 并放行对应端口范围 |
| 550 Permission denied | 权限不足 | 文件/目录权限或属主错误、SELinux 限制 | 校正权限(文件 644、目录 755),必要时调整 SELinux 布尔值(如 ftp_home_dir) |
| 451 Requested action aborted: local error in processing | 服务器处理请求出错 | 本地处理异常(如磁盘满、配置冲突) | 查看日志(/var/log/vsftpd.log、/var/log/messages),释放磁盘或修正配置 |
| 421 Service not available, closing control connection | 服务不可用 | 服务未启动、资源耗尽、配置错误 | 检查服务状态(systemctl status vsftpd)、查看日志与资源使用情况 |
定位与排查要点
补充说明