Detailed steps for ftp to connect to liunx server

"The ancients are powerless in learning, but the young and strong kung fu begins with old age."

The detailed steps of ftp connection to liunx server are often difficult to code and more difficult to produce high-quality goods. If you are not particularly lucky, please work hard first, do not fail because of laziness, and hypocritically attribute the cause to your own bad luck. You must work hard to appear effortless. If this article can bring you a little help, I hope to show your support to Little Brother Flying Rabbit with one click and three links. Thank you all friends.
table of Contents
One, install ftp service
2. Turn off the firewall
3. Modify selinux configuration and close selinux
Four, configure vsftpd
Five, restart the service
Sixth, add boot auto-start

One, install ftp service

yum install -y vsftpd

2. Turn off the firewall

  • Here is the command of centos7 as an example
  • Check the firewall status, running means it is running
systemctl status firewalld
  • Turn off the firewall
systemctl stop firewalld
  • Permanently turn off the firewall
systemctl disable firewalld

3. Modify selinux configuration and close selinux

  • Set the value of SELINUX to disabled
vim /etc/selinux/config

Four, configure vsftpd

  • View configuration vsftpd file
  • Find  /etc/vsftpd/
  • Found that the  ftp configuration has the following files
[[email protected] ~]# cd /etc/vsftpd/[[email protected] vsftpd]# lltotal 20-rw-------. 1 root root  125 Apr  1 12:55 ftpusers-rw-------. 1 root root  361 Apr  1 12:55 user_list-rw-------. 1 root root 5116 Apr  1 12:55 vsftpd.conf-rwxr--r--. 1 root root  338 Apr  1 12:55 vsftpd_conf_migrate.sh
  • Configure ftpusers, comment root
[[email protected] vsftpd]# vim ftpusers# Users that are not allowed to login via ftp# rootbindaemonadmlpsyncshutdownhaltmailnewsuucpoperatorgamesnobody~ 
  • Configure user_list, comment root
[[email protected] vsftpd]# vim user_list# vsftpd userlist# If userlist_deny=NO, only allow users in this file# If userlist_deny=YES (default), never allow users in this file, and# do not even prompt for a password.# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers# for users that are denied.# rootbindaemonadmlpsyncshutdownhaltmailnewsuucpoperatorgamesnobody
  • Configure vsftpd.conf
anonymous_enable=NO //禁止匿名登陆chown_uploads=YES //允许上传文件anon_upload_enable=YES //selinux未关闭时允许上传文件anon_mkdir_write_enable=YES //允许创建可写的目录

Five, restart the service

systemctl restart vsftpd

Sixth, add boot auto-start

systemctl enable vsftpd