在 CentOS 上让 FTP 服务器(如 vsftpd)开机自动启动,通常有以下几种方式,取决于你使用的 CentOS 版本(6 还是 7+)。
最常见的是 vsftpd:
rpm -qa | grep vsftpd
如果没安装:
yum install vsftpd -y
systemctl enable vsftpd
systemctl start vsftpd
systemctl status vsftpd
✅ 输出中有 enabled 表示已设置自动启动。
chkconfig vsftpd on
service vsftpd start
查看:
chkconfig --list vsftpd
systemctl enable proftpd
systemctl start proftpd
systemctl enable pure-ftpd
systemctl start pure-ftpd
firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload
临时测试:
setenforce 0
永久允许 FTP:
setsebool -P ftpd_full_access on
netstat -tunlp | grep ftp
✅ CentOS 7+ 标准方式
systemctl enable --now vsftpd
如果你用的是 特定 FTP 软件 或 CentOS 具体版本,可以告诉我,我可以给你更精确的配置。