Basic skills of Java programmers in Linux (3)

Source: Internet
Author: User
Tags file transfer protocol free ftp what is ftp
1. Install vsftpd and LeapFTP and make relevant configuration
1. Literacy first (1) What is vsftpd? If you want to build a secure, high-performance, and stable FTP server on your Linux/Unix server, vsftpd may be your preferred application. Vsftpd indicates "very secure FTP daemon (very secure FTP process )", is the name of the server running on a GPL-based UNIX-like operating system (a daemon ), it can run on systems such as Linux, BSD, Solaris, HP-UX, and IRIX. Vsftpd supports many other good features that are not supported by traditional FTP servers. (2) What is FTP? The full name of FTP is File Transfer Protocol (file transfer protocol). As its name implies, FTP is a protocol specifically used to transmit files. The main function of FTP is to allow users to connect to a remote computer (these computers run FTP server programs) to check what files are on the remote computer, then copy the files from the remote computer to the local computer, or send the files from the local computer to the remote computer. 2. Verify that vsftpd is installed when RedHat is installed. If vsftpd is selected, you do not need to manually install vsftp in the system. Otherwise, we need to install it manually. How to verify? Open putty (introduced in the previous section, do not understand me), connect to the remote Linux server and enter the following command line: rpm-Qa | grep vsftpd

If not, select the installation method. (1) Use the installation disk to install and insert the Red Hat Enterprise Linux 5 installation disc (the second disc). Run the following command: 1) First mount the disc to the system: mount/dev/CDROM/mnt
In this way, the content of the CD is mounted to the/mnt device, and now the content on the CD can be accessed through/mnt 2) install vsftp on the CD, and start vsftprpm-IVH vsftpd * 3) modify the startup mode to automatically start chkconfig vsftpd on when the system starts.
You can also view the startup Method
Chkconfig -- list | grep vsftpd
You can start ftpservice vsftpd start5 at random when 2-5 is on. 4) Test the connection to Windows + R, open the command line of windows, and enter the IP address of the FTP server, for example, if ftp192.168.40.128 appears ...... The installation is successful. (2) install with the download package (Note: This method is taken from idea) for example, we download the vsftpd-2.0.3.tar.gz; [root @ localhost ~] # Tar vsftpd-2.0.3.tar.gz zxvf [root @ localhost ~] # Cd vsftpd-2.0.3 [root @ localhost ~] # Make; make install (GCC is required here, which will be mentioned later) [root @ localhost ~] # Cp vsftpd. conf/etc and then modify/etc/vsftpd. conf: Add the following line to the last line of the configuration file. The Listen = Yes Method for installing the source code package. If your system is a RPM package-managed system, you can delete/etc/xinetd. d/vsftpd file; then start the xinetd server; [root @ localhost ~] #/Etc/init. d/xinetd restart stop xinetd: [OK] Start xinetd: [OK] vsftpd run in two modes. The re-checking system in RPM package management is mostly developed by fedora/RedHat, for such a system, there is an xinted server. For non-RPM package management systems, there is generally no xinted. To ensure the consistency of this document, we should not use the xinetd mode, but use the initd running mode to start and manage the server, that is, the independent running mode. Related reading: What are the xinetd and initd modes? Like other daemon programs, vsftpd provides standalone and inetd (inetd or xinetd) running modes. For a brief explanation, standalone is started at a time and remains in the memory during running. The advantage is that it responds quickly to the access signal, and the disadvantage is that it consumes a certain amount of system resources, therefore, it is often used on Professional FTP servers with high real-time response requirements. Inetd is the opposite. Because the FTP process is called only when an external connection sends a request, it is not suitable for systems with a large number of connections at the same time. In addition, inetd mode does not occupy system resources. In addition to the impact of response speed and resource occupation, vsftpd also provides some additional advanced features, such as inetd mode support per_ip (Single IP) restrictions, while
Standalone mode is more conducive to the application of the PAM verification function. The difference between xinetd mode and standalone mode: a service running in Xinetd mode indicates that the service process is not executed by the daemon process. Take the ftpd process as an example and run the service in Xinetd mode, this is the case. The FTP service listens to port 21, but if you run this service in this mode, port 21 is monitored by the xinetd process (at this time, the ftpd service is not running). If your network adapter receives port 21 requests, the xinetd process will call the ftpd program, the request data received on port 21 is handed over to the ftpd process for processing. After processing, the ftpd process exits, and the xinetd process continues to listen to port 21, this is a bit similar to the Windows svhost process.
Standalone is a service process. For example, ftpd runs in the memory as a daemon. After receiving the request on port 21, the ftpd process fork processes a sub-process, the original process continues to listen to port 21. ¥ Xinetd run mode most newer systems use the Xinetd super service daemon process. Use "VI/etc/xinetd. d/vsftpd: Disable = No socket_type = streamwait = No # This indicates that the device is activated and is using standard TCP sockets. If "/etc/vsftpd. in Conf, the option is "Listen = yes". After canceling the command, restart xinetd. The command is as follows: $/etc/rc. d/init. d/xinetd restart, note that "/etc/xinetd. d. Only one FTP service can be enabled in the directory. The standalone mode facilitates Pam verification. In this mode, you must first disable vsftpd in Xinetd, set "Disable = yes", or cancel the corresponding lines in "/etc/inetd. conf. Modify the option "Listen = yes" in "/etc/vsftpd. conf ". If standlone mode is used, it is started as a separate service and does not require system collaboration or as a system service. If it becomes xinetd mode, therefore, its services must be restricted by system services, such as creating a new service process, but it also has disadvantages. If the xinetd service has a problem, related services will also be affected. What problems may be encountered by the supervisor? $ vsftpd anonymous users cannot upload or delete files. $ root users cannot log on. Therefore, we need vsftp for simple configuration. 3. vsftpd configuration.

There are three main configuration files:
/Etc/vsftpd. conf
/Etc/vsftpd. ftpusers
/Etc/vsftpd. user_list

We recommend that you use the "CP" command to back up the three files before modification. After modification, you must restart the vsftpd service to make the settings take effect.

Anonymous user access configuration
¥ After startup, the FTP server will be able to log on.
In text mode, anonymous users must use the user name FTP, and the password is also FTP for login. If FTP is used for anonymous login, both the user name and password are: Anonymous. By default, anonymous users can access and download files, but cannot upload, delete, create directories, and execute files!
A local user can log on and exit his/her own directory to another directory that he/she has the permission to access, upload and download files with the permission, and write the files in/etc/vsftpd. local users in ftpusers cannot log on.

$ Allow anonymous users to upload files
Modify the/etc/vsftpd. conf file and remove the "#" before the following two items.
Anon_upload_enable = Yes
Anon_mkdir_write_enable = Yes
Restart the vsftpd service.

$ Only anonymous users are allowed to access
Modify the/etc/vsftpd. conf file and remove the "#" before the following two items.
Local_enable = Yes
Write_enable = Yes
Restart the vsftpd service.

$ Set welcome information
Modify the/etc/vsftpd. conf file
Ftpd_banner = *****
* ***** Indicates the set welcome information.
Restart the vsftpd service.

¥ Set the maximum transmission rate
Modify the/etc/vsftpd. conf file
Set the maximum transmission rate of anonymous users to 20 kbps. Add the following statement:
Anon_max_rate = 20000
Set the maximum transmission rate of the local account to 1 Mbps. Add the following statement:
Local_max_rate = 1000000

¥ Set the maximum number of concurrent servers and the maximum number of threads for users
Modify the/etc/vsftpd. conf file
To set the maximum number of concurrent connections on the server to 99, add the following statement:
Max_clients = 99
To set the maximum number of connections in the same time period, add the following statement:
Max_per_ip = 5

$ Prohibit anonymous access to the server from hosts of certain IP segments
Modify the vsftpd. conf file and make sure the following statements are available:
Tcp_wrappers = Yes
Modify the/etc/hosts. Allow file and add the following command line:
Vsftpd: 192.168.1.1: deny
Restrict hosts with IP address 192.168.1.1 from accessing the FTP server.
Restart the vsftpd service.

$ Transmit data using ASCII
Modify the/etc/vsftpd. conf file,
Ascii_upload_enable = Yes
Ascii_download_enable = Yes
Restart the vsftpd service.

¥ Set the data transmission interruption Interval
Modify the/etc/vsftpd. conf file,
Idle_session_timeout = 600
The idle session time is 600 seconds.
Data _ connection_timeout = 120
Indicates that the data connection timeout is 120 seconds.
Restart the vsftpd service.

Local user access configuration


$ Use the user list for access control
Modify the/etc/vsftpd. conf file and set it according to the following statement:
Userlist_enable = No
This indicates that the user in the vsftpd. ftpuser file will not be able to access the FTP server.
Userlist_enable = Yes
Userlist_deny = No
Indicates that only users in the vsftpd. user_list file are allowed to access the FTP server.
Userlist_enable = Yes
Userlist_deny = Yes
It indicates that users in the vsftpd. ftpuser and vsftpd. user_list files cannot access the FTP server.

¥ Restrict access to User Directories
Modify the/etc/vsftpd. conf file
Chroot_local_user = Yes
It indicates that the user cannot access other directories or files than the user's directory after logging on.

¥ Modifying the default port
The default port of the FTP server is 21. To modify the port, modify the/etc/vsftpd. conf file. the following statement:
Listen_port= 4444
Indicates that the port number of the FTP server is 4444 and should be greater than 4000

3. Install LeapFTP followed by literacy (1) What is LeapFTP? LeapFTP is one of the most compact and powerful FTP tools. It features a friendly user interface and stable transmission speed. LeapFTP, flashfxp, and CuteFTP are three key ftp users. Flash fxp transmission speed is relatively fast, but sometimes it cannot be connected to some education network FTP sites; LeapFTP transmission speed is stable and can connect to the vast majority of FTP sites (including some education network sites ); although CuteFTP is relatively large, it comes with many free FTP sites with rich resources. In short, the three have their own strengths.
Download the green version from Google and decompress it directly.
It is easy to use.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.