CentOS 7 部署 FTP

记录下CentOS 7 下yum安装vsftp的步骤步骤

查看是否已安装VSFTP

vsftpd -version

安装vsftp

yum -y install vsftpd

配置参数

vi /etc/vsftpd/vsftpd.conf

以下是我的配置

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/xferlog
xferlog_std_format=YES
chroot_local_user=YES
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
allow_writeable_chroot=YES
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=40100

重启FTP,设为开机启动

systemctl restart vsftpd.service
systemctl enable vsftpd.service

修改防火墙配置,并重启

firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload

添加ftp用户,禁止shell登录

useradd -d /home/test -m test -s /sbin/nologin
cd /home/test
chmod -R 777 *

设置ftp用户密码

passwd test

搞定~

Leave A Comment

Please be polite. We appreciate that. Your email address will not be published and required fields are marked