VSFTPD 服务器

VSFTPD 服务器

文章目录

vsftpd 介绍

vsftpd(Very Secure FTP Daemon)是一个在 Linux 系统上广泛使用的 FTP 服务器软件,以其安全性、高性能和稳定性著称。vsftpd 设计理念注重安全,通过多种机制(如 chroot 隔离、PAM 认证、SSL/TLS 加密等)保护系统免受潜在攻击。

vsftpd 基本配置

安装 vsftpd

bash 复制代码
# 安装 vsftpd
[root@server ~]# yum install -y vsftpd

# 启动 vsftpd 服务
[root@server ~]# systemctl enable vsftpd --now

# 检查服务状态
[root@server ~]# systemctl status vsftpd

防火墙配置

bash 复制代码
#关闭防火墙或者配置防火墙

# 允许 FTP 服务通过防火墙
[root@server ~]# firewall-cmd --permanent --add-service=ftp

# 重新加载防火墙规则
[root@server ~]# firewall-cmd --reload

基本配置文件

bash 复制代码
#vsftpd 的主配置文件位于 /etc/vsftpd/vsftpd.conf

#备份原始配置文件
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak

匿名用户访问配置

bash 复制代码
#修改如下参数

anonymous_enable=YES            # 允许匿名用户
no_anon_password=YES            # 匿名用户无需密码

#匿名用户访问配置可忽略
anon_root=/var/ftp/pub          # 匿名用户根目录

anon_upload_enable=NO           # 禁止匿名用户上传
anon_mkdir_write_enable=NO      # 禁止匿名用户创建目录
anon_other_write_enable=NO      # 禁止匿名用户执行额外的写操作,例如删除和重命名

[root@server ~ 11:25:23]# cd /var/ftp/pub/
[root@server pub 11:25:58]# cp /etc/hos* .
[root@server pub 11:26:19]# ls
host.conf  hostname  hosts  hosts.allow  hosts.deny

[root@server ftp 11:28:30]# chmod o=rwx pub/
[root@server ftp 11:28:49]# ll
total 0
drwxr-xrwx 2 root root 89 Nov 28 11:26 pub

#xftp验证即可
#协议ftp,21端口,设置匿名登录

#注意修改完重启vsftpd 服务
systemctl restart vsftpd

本地用户访问配置

bash 复制代码
#修改如下配置

anonymous_enable=NO            
no_anon_password=NO          

local_enable=YES                # 允许本地用户

#重启 vsftpd 
 systemctl restart vsftpd
 
#xftp验证即可
#协议ssh服务22端口,填写用户名和密码登录

#重启 vsftpd

systemctl restart vsftpd

#xftp验证即可

#协议ssh服务22端口,填写用户名和密码登录

复制代码
相关推荐
小此方1 小时前
Linux网络(一):揭秘从网络发展哲学到 TCP/IP 协议栈分层设计的设计哲学
linux·网络·tcp/ip
星野爱8951 小时前
远程控制哪家安全性更高?ToDesk、UU远程、向日葵隐私屏深度测评!
linux·运维·网络
ALINX技术博客1 小时前
【黑金云课堂】FPGA技术教程Linux开发:系统定制
linux·运维·fpga开发
M哥支付1 小时前
什么是收付一体模式?
服务器·网络·其他·微信·金融
ShineWinsu1 小时前
对于Linux:传输层协议UDP原理的解析
linux·c++·面试·udp·协议·传输层·计算机系统
bmjwin2 小时前
一个监控脚本实时追踪记录进程隐秘连接ip方法
运维·服务器
霁月的小屋2 小时前
Docker 工程化实践(六):Docker Compose 管理多容器应用
运维·docker·容器
2601_965798472 小时前
How to Build a Custom Artisan Store on WordPress: Crafti Theme Review
linux·服务器·数据库
mounter6252 小时前
深度解析 Linux 内核中的 iomap 子系统:历史、演进、核心机制与未来
linux·文件系统·linux kernel·kernel·iomap
luyun0202023 小时前
论坛里的小工具,吾爱出品
运维·服务器·windows