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