Before installing, understand the default installation directory
If vsftpd is installed by default, the following are the location conventions for some files:
/usr/sbin/vsftpd --- VSFTPD main program
/etc/rc.d/init.d/vsftpd --- Startup script
/etc/vsftpd/vsftpd. conf ——- Main configuration file
/etc/pam.d/vsftpd ——- PAM authentication file
/etc/vsftpd.ftpuusers ——- User list file that prohibits using VSFTPD
/etc/vsftpd.user_list ——- List of users who are prohibited or allowed to use VSFTPD file
/var/ftp -- home directory for anonymous users
/var/ftp/pub -- download directory for anonymous users
If you want to change the default download directory, modify /etc/vsftpd/vsftpd.conf and add the following three lines: local_root=
/
chroot_local_user=YES
anon_root=/
local_root indicates the default directory when using a local user to log in to ftp
anon_root indicates the default directory when an anonymous user logs in to ftp
Check SELinux status first and turn off SELinux
sestatus -v View status
vi /etc/sysconfig/selinux
将 SELINUX=disabled
1. Check whether the vsftpd server is installed in centos
rpm -qa | grep vsftpd
If it appears: vsftpd-3.0.2-11.el7_2.x86_64, it proves that the vsftpd server has been installed
Then delete the vsftpd server: yum remove vsftpd
2. Install vsftpd server
yum install vsftpd
3. Check whether the vsftpd server is started
systemctl status vsftpd
4. Set to boot
systemctl enable vsftpd
5. Copy the configuration file and make a backup
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
6. Do not allow anonymous users to log in
vi /etc/vsftpd/vsftpd.conf
modify the file
anonymous_enable=NO
Restart vsftpd server
systemctl restart vsftpd
7. Install the client
yum install ftp
8. Test whether it is installed as
ftp localhost
9. Open the port
firewall-cmd --zone=public --add-port=21/tcp --permanent
Command meaning:
--zone #Scope --add-port=21/tcp #Add
port, the format is : Port/communication protocol
--permanent #Permanent effect, invalid after restart without this parameter
10. Restart the firewall
firewall-cmd --reload
all open ports
firewall-cmd --list-all--zones