Linux中的FTP(File Transfer Protocol,文件传输协议)服务是一种用于在网络上进行文件传输的标准协议,其主要用途和功能如下:
跨平台文件共享
集中式文件存储
自动化文件传输
lftp
、wget
),常用于备份、日志收集等自动化任务。/var/www/html
)。ftp://ftp.example.com
)提供公共文件下载。vsftpd(Very Secure FTP Daemon)
/etc/vsftpd.conf
中设置anonymous_enable=NO
禁用匿名登录。ProFTPD
Pure-FTPd
chroot_local_user=YES
),避免越权访问。bash
sudo ufw allow from 192.168.1.0/24 to any port 21
安装vsftpd(Ubuntu为例):
sudo apt update && sudo apt install vsftpd
sudo systemctl start vsftpd
客户端连接:
ftp ftp.example.com
# 或使用lftp(支持断点续传):
lftp -u username ftp.example.com
常用FTP命令:
put file.txt
上传文件get file.txt
下载文件ls
列出远程目录总结:Linux FTP服务适合需要简单文件共享的场景,但需注意安全风险。现代环境中更推荐使用SFTP/SCP或云存储解决方案(如Nextcloud)。