CentOS7部署vsftpd服务

FTP服务器部署与配置

操作系统:Centos 7

查看linux服务器是否存在vsftpd,存在就先卸载已有版本

rpm -qa | grep vsftpd
rpm -e vsftpd

使用yum安装vsftpd

sudo yum -y install vsftpd

创建ftp用户并设置密码

mkdir /path/to/ftp
useradd jimiftp -d /path/to/ftp -s /sbin/nologin
chown -R jimiftp /path/to/ftp
passwd jimiftp
#两次输入密码

修改vsftp配置文件

# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO

local_enable=YES

write_enable=YES

local_umask=022

dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#在不配置端口的情况下ftp默认端口21,注意防火墙开启访问权限
#listen_port=11233


xferlog_std_format=YES

ftpd_banner=Welcome to JIMI TEST FTP service.
listen=NO

listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

vsftp加入到systemd自启动服务中并启动

systemctl enable vsftpd.service
systemctl start vsftpd.service
#查看服务运行状态
systemctl status vsftpd.service

最后使用ssh工具或者浏览器访问ftp服务器即可

ftp://youip_or_hostname:port
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容