Install and configure the Linux ftp service and use IE to access Linux ftp
I. installation and configuration of Linux FTP
(1) install FTP: directly use the yum command to install FTP in Centos
Su root
Yum install ftp
Yum install vsftpd
(2) configure the FTP service
Start vsftpd:/sbin/service vsftpd start
The default Vsftpd server folder is/var/ftp/pub.
The configuration file of the Vsftpd server is/etc/vsftpd. conf.
Add an FTP local user for the FPT logon permission, but do not log on to the local system:
/Usr/sbin/adduser-d/opt/test_ftp-g ftp-s/sbin/nolongin test command means:
Use the command (adduser) to add the test user. You cannot log on to the system (-s/sbin/nologin). Your own folder is in (-d/opt/test_ftp )), belong to the group ftp (-g ftp) and then you need to set the password passwd test for it
(3) add firewall rules
Iptables-I INPUT-p tcp -- dport 21-j ACCEPT allows port 21 to be opened
After the FTP configuration is complete, you can access it through the command line.
Ii. Access Linux FTP through IE
In many cases, after VSFTPD is installed, most users can log on normally through the command line. However, no logon is found in the browser. This is because VSFTPD does not support passive mode. You can modify the browser settings so that the browser cannot connect in passive mode.
Configuration method:
Method (1): Open the scanner --- tools --- internet Options --- advanced remove the "use Passive FTP" item
Method (2): Allow VSFTPD to support passive mode. This method is to modify the FTP server configuration so that the client does not need to change the IE configuration options.
A. First configure the vi/etc/vsftpd. conf file and add
Pasv_enable = YES
Pasvanderbilt max_port = 30100
Pasv_min_port = 30000
(The above 30000--30100 port number can be other ones. Here is an example)
B. Open Firewall Configuration:
Vi/etc/sysconfig/iptables Add the following two rows
-A RH-Firewall-1-INPUT-p tcp -- dport 30000: 30100-j ACCEPT
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 21-j ACCEPT
C. Restart two services:
[Root @ extmail ~] # Service iptables restart
[Root @ extmail ~] # Service vsftpd restart
Other FTP security configurations are attached:
1. To ensure that you can read and write your own directories, you must set it in the configuration file vsftpd. conf to read and write.
Local_enable = yes
Write_enable = yes
Local_umask = 022
2. upload and download anonymously
Modify the configuration file to vsftpd. conf. Make sure there are the following lines. You can add them without yourself.
Anonymous_enable = yes
Anon_upload_enable = yes
Anon_mkdir_write_enable = yes
Anon_umask = 022
Then you can create a new folder and change its permissions to fully open. Any user can log on to the folder and upload and download files:
Mkdir/var/ftp/guest
Chmod 777/var/ftp/guest
3. Customize the welcome information for accessing the FTP server
Set in the vsftpd. conf file:
Dirmessage_enable = yes
Then go to the user directory and create a. message file. Enter the Welcome information (Welcome to gxlinux's FTP is written here !) :
[Root @ localhost test_ftp] # ftp 192.168.0.33
Connected to 192.168.0.33 (192.168.0.33 ).
220 (vsFTPd 2.0.5)
Name (192.168.0.33: gxl): test
331 Please specify the password.
Password:
230-Welcome to gxlinux's FTP!
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
4. Implement Virtual paths
Mount a directory to an FTP server for your use. This is called a virtual path.
For example, mount the gxl user directory to the FTP server for use by FTP Server users. Run the following command:
[Root @ localhost opt] # mount -- bind/home/gxl/var/ftp/pub # Use the mount command
[Root @ localhost opt] # ls/var/ftp/pub
LumaQQ Screenshot.png Desktop
5. Enable the log function of vsFTPd
Add the following line to the vsftpd. conf file. Generally, this line exists in the file. You only need to remove the annotator #. If not, add or modify the line:
Xferlog_file =/var/log/vsftpd. log
6. Limit the number of links and the maximum number of links for each IP Address
Modify the configuration file. For example, vsftp supports a maximum of 100 connections. Each IP address supports five links:
Max_client = 100
Max_per = 5
7. Limited transmission speed
Modify the configuration file, for example, allow anonymous users and users on vsftd (I .e. virtual users) to download at 80 KB = 1024*80 = 81920
Anon_max_rate = 81920
Local_max_rate = 81920