Home  >  Article  >  System Tutorial  >  How to set up FTP on the server in CentOS7.2?

How to set up FTP on the server in CentOS7.2?

王林
王林forward
2024-01-06 18:14:21775browse

Currently, most of the FTP servers deployed in Linux are vsftpd. As for why, there is no need to delve into it for the time being.

1. Install vsftpd

# yum check-update
# yum -y install vsftpd

2. Configuration parameters

# vi /etc/vsftpd/vsftpd.conf

Modify to the following parameters

anonymous_enable=NO
chroot_local_user=YES
allow_writeable_chroot=YES
pasv_enable=YES
pasv_min_port=40000
pasv_max_port=40100

3. Restart ftp

# systemctl restart vsftpd.service
# systemctl enable vsftpd.service

4. Modify firewall configuration

# firewall-cmd --permanent --add-service=ftp
# firewall-cmd --reload
# setsebool -P ftp_home_dir on

5. Create a user test1 for ftp (the specified directory is /home/www, remote login shell is not allowed)

# useradd -d /home/www -m test1 -s /sbin/nologin

6.Set a password for the ftp user

# passwd test1

The above is the detailed content of How to set up FTP on the server in CentOS7.2?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete