在 Ubuntu 上重启 FTPServer(FTP over SSL/TLS),通常取决于你使用的是哪种 FTP 服务软件。最常见的是 vsftpd,下面按常见情况说明。
先确认服务名:
systemctl list-units --type=service | grep -E "ftp|vsftp"
常见结果:
vsftpd.serviceproftpd.servicepure-ftpd.servicesudo systemctl restart vsftpd
sudo systemctl status vsftpd
sudo systemctl enable vsftpd
sudo systemctl restart proftpd
sudo systemctl status proftpd
sudo systemctl restart pure-ftpd
sudo systemctl status pure-ftpd
有些系统可能是
pure-ftpd.service或其他变体,用systemctl list-units确认。
重启方式一样,只是配置文件不同:
/etc/vsftpd.conf
关键配置示例:
ssl_enable=YES
rsa_cert_file=/etc/ssl/certs/your_cert.pem
rsa_private_key_file=/etc/ssl/private/your_key.pem
修改配置后 必须重启服务才生效:
sudo systemctl restart vsftpd
ss -antp | grep :21
或使用客户端测试:
ftp localhost
查看日志:
sudo journalctl -u vsftpd
检查防火墙:
sudo ufw status
sudo ufw allow 21/tcp
如果你愿意,可以告诉我:
我可以给你更精确的命令和配置示例。