Installation Environment: centos-release-7-2.1511.el7.centos.2.10.x86_64
Installation path: Install via Yum online
Install VSFTPD:
[email protected] ~]# Yum Isntall vsftpd-y
Enable and shutdown of the service:
Start: Systemctl start Vsftpd.service
Close: Systemctl Stop Vsftpd.service
Restart: systemctl Restart Vsftpd.service
View status: Systemctl status Vsftpd.service
To view ports:
[Email protected] ~]# Netstat-nltp|grep 21
TCP6 0 0::: +:::* LISTEN 2504/vsftpd
Configuration file Description:
The configuration directory for VSFTPD is/ETC/VSFTPD and contains the following configuration files:
Vsftpd.conf as the primary configuration file
Ftpusers Configuring a list of users who are forbidden to access the FTP server
User_list Configuring user Access Control
Modify Permissions: vi/etc/vsftpd/vsftpd.conf
[Email protected] ~]# Cat/etc/vsftpd/vsftpd.conf|grep-ev "^#|^$"
#禁用匿名用户
Anonymous_enable=yes
#禁用本地账户
Local_enable=yes
#编辑权限
Write_enable=yes
local_umask=022
Dirmessage_enable=yes
Xferlog_enable=yes
Connect_from_port_20=yes
Xferlog_std_format=yes
#禁止切换根目录
Chroot_local_user=yes
#监听
Listen=no
Listen_ipv6=yes
Pam_service_name=vsftpd
Userlist_enable=yes
Tcp_wrappers=yes
After you have edited the configuration file, you need to restart the VSFTPD service: systemctl restart Vsftpd.service
Create an FTP user
Useradd ftpadmin
echo "Ftpadmin" |passwd ftpadmin--stdin
Restrict the user from FTP access only
Usermod-s/sbin/nologin Ftpadmin
Assign the user to the user ftpadmin to the main directory, and agree/data/ftp main directory
1. Create the/data/ftp/pub directory Mkdie-p/data/ftp/pub
2. Write Welcome file/data/ftp/welcome.txt
3.echo "Welcome to use FTP service." >/data/ftp/welcome.txt
Set access rights chmod a-w means not writable (All-write)
chmod a-w/data/ftp/&& chmod 777-r/data/ftp/pub
Set User home Directory
Usermod-d/datda/ftp/ftpadmin
Restarting the server
sudo systemctl restart Vsftpd.service
Finally, enter the FTP://IP address on the browser to
Using VSFTPD to erect ftp in Linux