yum install -y vsftpd
systemctl enable vsftpd.service
systemctl start vsftpd.service
netstat -antup | grep ftp
useradd ftptestpasswd ftptestmkdir /var/ftp/test # 创建一个供ftp服务使用的文件目录chown -R ftptest:ftptest /var/ftp/test # 修改该目录的拥有者为ftptest
#除下面提及的参数外,其他参数保持默认值即可。#修改下列参数的值anonymous_enable=NO #禁止匿名登录FTP服务器local_enable=YES #允许本地用户登录FTP服务器listen=YES #监听IPv4 sockets#在行首添加#注释掉以下参数#listen_ipv6=YES #关闭监听IPv6 socketslocal_root=/var/ftp/testchroot_local_user=YESchroot_list_enable=YESchroot_list_file=/etc/vsftpd/chroot_listallow_writeable_chroot=YESpasv_enable=YESpasv_min_port=50000pasv_max_port=51000pasv_address=你的公网ip
vim /etc/vsftpd/chroot_list # 哪怕没有例外用户也必须创建# 8.重启systemctl restart vsftpd.service
注意:如果使用的是云服务器,一定要记住开放响应的端口。
最后,如有问题,请留言。
联系客服