编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

centos8 安装ftp服务-vsftpd

wxchong 2024-06-28 10:40:05 开源技术 13 ℃ 0 评论

简介

FTP(文件传输协议)是一种用于通过网络在服务器和客户端之间传输文件的传统并广泛使用的标准工具,特别是在不需要身份验证的情况下(允许匿名用户连接到服务器)。

请注意,本指南中的所有命令将以 root 身份运行,如果你不使用 root 帐户操作服务器,请使用 sudo命令 获取 root 权限。

安装vsftpd

安装启动服务并添加开通防火墙

[root@localhost ~]# yum install vsftpd
[root@localhost ~]# systemctl start vsftpd
[root@localhost ~]# systemctl enable vsftpd
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=21/tcp
success
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-service=ftp
success
[root@localhost ~]# firewall-cmd --reload
success
#开启家目录访问(默认selinux开启,必须设置)
[root@localhost ~]# semanage boolean -m ftpd_full_access --on

配置vsftpd服务

1、备份配置文件

cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf-`date +%Y%m%d`.bak

2、配置文件介绍

cat /etc/vsftpd/vsftpd.conf|grep -v '^#'


3、本地root用户登陆访问的配置

[root@localhost vsftpd]# cd /etc/vsftpd/

[root@localhost vsftpd]# cat ftpusers 
# Users that are not allowed to login via ftp

[root@localhost vsftpd]# cat user_list 
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
root

[root@localhost vsftpd]# cat vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
connect_from_port_20=YES
xferlog_enable=YES
xferlog_std_format=YES
dual_log_enable=YES
xferlog_file=/var/log/xferlog
vsftpd_log_file=/var/log/vsftpd.log
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
userlist_deny=NO
chroot_local_user=YES
allow_writeable_chroot=YES
use_localtime=YES

#重启服务
systemctl restart vsftpd

然后测试 下载FileZilla Client客户端:https://filezilla-project.org/



4、vsftpd日志说明




Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表