vsftpd installation guide for beginners

  • 2020-05-15 03:15:43
  • OfStack

The vsFTPd packages are available in the installation disks of the latest major distributions, and you can install them using the package management tools provided by the respective distributions. Of course, you can find vsftpd packages in the FTP images of major distributions; Of course, you can also install it online with the management tools of the software package. vsftpd's software package is not that big. It doesn't take long. Two minutes is enough. Because this is a beginner's tutorial, I strongly recommend that you use the software provided with the distribution to install, not to compile your own source code package installation;

If you are using an Fedora or Redhat system, you can install it online with the following command.

[root@localhost ~]# yum install vsftpd

If it is an debian system, you can use apt to install it online.

[root@localhost ~]# apt-get install vsftpd

If you are an RPM system, you can also find the vsftpd-xxxx.rpm package to install through the rpm command;

[root@localhost ~]# rpm -ivh vsftpd*.rpm

You can download the source package to install

For example, we downloaded vsftpd-2.0.3.tar.gz;


[root@localhost ~]# tar zxvf vsftpd-2.0.3.tar.gz
[root@localhost ~]# cd vsftpd-2.0.3
[root@localhost ~]# make ;make install
[root@localhost ~]# cp vsftpd.conf /etc

Then modify /etc/ vsftpd.conf by adding the following line to the last line of the configuration file;

listen=yes
Source package installation method, if your system is RPM package management system, you can delete/etc/xinetd d/vsftpd this file; Then start the xinetd server;

[root@localhost ~]# /etc/init.d/xinetd restart

Stop xinetd: [ok]
Start xinetd: [ok]

There are two modes of vsFTPd operation. In the system of RPM package management, most of them are developed by Fedora/Redhat. For such systems, there are xinted server 1. For systems that are not RPM package managed, 1 generally does not have xinted as this 1 says. To keep this document consistent, let's not use xinetd mode, but initd run mode to start and manage the server, that is, standalone.

What are xinetd mode and initd mode

Like other daemons 1, vsftpd provides both standalone and inetd (inetd or xinetd) modes of operation. In brief explanation 1, standalone1 is a secondary startup, during which 1 is directly resident in memory. The advantage is that it responds quickly to the access signal, while the disadvantage is that it consumes 1 certain system resources. Therefore, it is often used in professional FTP servers with high requirements for real-time response. inetd, on the other hand, is not suitable for systems with a high number of simultaneous connections because it calls the FTP process only when an external connection sends a request. In addition, the inetd mode does not consume system resources. In addition to the impact of speed and resource usage, vsftpd also provides some additional advanced features, such as inetd mode support for per_IP(single 1IP) restriction, while standalone mode is more conducive to the application of PAM validation.

1. xinetd operation mode

Most newer systems use the xinetd super service daemon. . Use the "vi/etc xinetd d/vsftpd" l see its content, as follows:

disable = no
socket_type = stream
wait = no
This indicates that the device is active and is using the standard TCP Sockets.
If "/etc/ vsftpd.conf" has the option "listen=YES", log it off
Finally, restart xinetd with the following command:
$ /etc/rc.d/init.d/xinetd restart
Note that only one FTP service can be enabled in the "/etc/ xinetd.d" directory.

2. standalone mode

The standalone mode facilitates the implementation of PAM validation. To enter this mode, first close vsftpd under xinetd, set

"disable = yes", or log out the corresponding line in "/etc/ inetd.conf". Then modify "/etc/ vsftpd.con

The option in "f" is "listen=YES".

If it is standlone mode, then it is started as a single service, no system collaboration is required, not as a system service,

If it becomes xinetd mode, then its service will be limited by the system service, such as creating a new service process. However, it also has disadvantages. If the xinetd service itself has problems, then the relevant service will also be affected.

The difference between xinetd mode and standalone mode

Expressed in xinetd running mode of service is not in order to protect the service process execution, FTPD process, for example, in xinetd mode running the service, is such, itself FTP service will be listening port number 21, but in this mode, the service, the 21 port by the xinetd process to monitor (FTPD service is not running) at this time, if you have a network card to receive 21 port request, has to call FTPD routine xinetd process, will be received at port 21 The request data is transferred to the FTPD process for processing. After processing, the FTPD process exits, while the xinetd process continues to listen to port 21, which is similar to the svhost process of windows. The service running in standalone mode is the service process. For example, ftpd runs in memory as a daemon. After receiving the request from port 21, FTPD process fork sends out a sub-process for processing, while the original process continues to listen to port 21.


Related articles: