I say Linux - centos ftp installation components

First, demand

The so-called "a Java, a single operation and maintenance," we developed Javaweb projects (whether using ssm or springboot), typically use the VMware software and centos system installed on the software, how to develop a good project to deploy the system centos on.

Transferring files between file transfer aspect, a server system and centos machines generally used FileZilla, using ftp transfer request, which components need to be installed on the ftp centos system. This section describes the entire process i.e. centos ftp mounting assembly.

Second, the specific steps

1, the mounting assembly vsftpd

[root@bogon ~]# yum -y install vsftpd

2, add a user ftp

[root@bogon ~]# useradd ftpuser

Such a user to build complete, you can use this login, remember to use common logon do not use the anonymity. The default login path for the / home / ftpuser.

3, to add ftp user password

[root@bogon ~]# passwd ftpuser    mypassword

After you enter the password twice to change the password.

4, the firewall is turned on or off the firewall port 21 (here centos7 version, NA centos6.5 or other low version), open the ftp service

Add
firewall-cmd --zone = public --add- port = 20 / tcp --permanent (--permanent permanent, this argument does not fail after the restart)
reload
firewall-cmd --reload
view
firewall-cmd - zone = public --query-port = 20 / tcp

Use the command: systemctl status firewalld.service view the status of the firewall ''

Use the command: systemctl stop firewalld.service turn off the firewall

Use the command: systemctl start firewalld.service open the firewall

su - root # to switch to root privileges

service vsftpd status # View FTP status

service vsftpd start # Enable the FTP service

5, modify the selinux

Outside the network can access up, but found not return directory (using ftp active mode, passive mode or inaccessible), also can not upload because selinux mischief.

Modify selinux:

Execute the following command to view the status:

[root@bogon ~]# getsebool -a | grep ftp  

allow_ftpd_anon_write --> off

allow_ftpd_full_access --> off

allow_ftpd_use_cifs --> off

allow_ftpd_use_nfs --> off

ftp_home_dir --> off

ftpd_connect_db --> off

ftpd_use_passive_mode --> off

httpd_enable_ftp_server --> off

tftp_anon_write --> off

[root@bogon ~]#

Execute the above command, and then return the results to see the two lines are off, on behalf of, no open access to external networks

[root@bogon ~]# setsebool -P allow_ftpd_full_access on

[Root @ bogon ~] # -P ftp_home_dir on setsebool

 

This should be no problem (if, or not, see if it is with the ftp client tools using the passive mode access, such as the prompt Entering Passive mode, on behalf of a passive mode, the default does not work, because the ftp passive mode is iptables blocked, the following will talk about how to open, if not bother to open the case, take a look at the options if you have a port mode ftp client, or the option of removing the passive mode. If the client does not work, look on the client host the computer is a firewall to open and close it)

Attached: FileZilla active, passive mode Review: Menu: Edit Settings →

 

6, turn off anonymous access

/Etc/vsftpd/vsftpd.conf modify the file:

Restart the ftp service:

[root@bogon ~]# service vsftpd restart

7, turn on passive mode

Without seventh step, FileZilla successful connection but failed to read the directory

It is enabled by default, but you want to specify a range of ports, vsftpd.conf open the file, followed by the

pasv_enable=YES

pasv_min_port=30000

pasv_max_port=30999

The port range of 30000 to 30999, this can be freely changed. Change complete restart the vsftpd

Because of this specified port range, iptables also appropriate to open this range, so open iptables file as above.

Also on a separate line below 21, more similar to that line, just read 21 30000: 30999, then: wq save and restart under iptables. This will get.

we /etc/vsftpd/vsftpd.conf

Restart the ftp service:

[root@bogon ~]# service vsftpd restart

8, set to open to start vsftpd ftp service

[root@bogon ~]# chkconfig vsftpd on

Spank code, progress every day!

Published 177 original articles · won praise 31 · views 80000 +

Guess you like

Origin blog.csdn.net/qq_36963950/article/details/103339023