vsftpd is a Linux distribution in the most respected FTP server program, very easy to use, I have spent a long time, then I will introduce the next VSFTPD learning Guide.
1, VSFTPD, the current common FTP server suite;
VSFTPD is one of the most highly recommended FTP server programs in Linux distributions; it is small and light, safe and easy to use, can make its own characteristics have to play and master, but also the most important is used;
Currently in the open source operating system commonly used FTPD kits are mainly proftpd, pureftpd and wuftpd, and so on which FTP server suite is better, which is you most familiar with, which is the best;
2, the FTP user management explanation;
FTP Server Management of users, in the default case is based on/etc/passwd and/etc/group, so we must understand the Linux system user and user group management, user and user group management is the basis of all applications, some brothers do not want to understand the basis of things, Just want to step into a good rack of various servers, it turns out that this learning method is the most unwise; Although you may have started the FTP server in a few minutes, you don't necessarily know what went wrong when you encounter a problem, so the basics are extremely important;
Recommended articles: Linux User (user) and group Management overview
2.1, anonymous FTP users and user groups to understand;
When we visit the major FTP access, we may not think of what identity we are logged in, if his FTP allows anonymous logon, such as we are in the browser to enter;
ftp://mirrors.kernel.org
Or
ftp://ftp:ftp@mirrors.kernel.org
We will find that the above two lines will eventually be accessible, and the results are exactly the same, and eventually all jump to the ftp://mirrors.kernel.org address; So when we visit this FTP, is there a user and password? Yes, it is also needed, just on the server side to allow anonymous access, Anonymous access to the username and password are FTP, but we are anonymous access, did not feel that he has a username and password bale. The second address is to FTP users, password is FTP to access ftp://mirrors.kernel.org;
If we use FTP command to connect mirrors.kernel.org, we will find that we need to enter user FTP, password ftp to access;
In an FTP server, the username and password of an anonymous user are FTP; This user can be found in the/etc/passwd of your operating system; There may be a line similar to the following;
Ftp:x:14:50:ftp User:/var/ftp:/sbin/nologin
Description
/ETC/PASSWD is the system user profile,/etc/group is the System user group profile, and you can learn some of the basics of user management through the Linux user and user Group Management overview and its related documentation;
In the FTP user line, we see seven fields, each of which is separated by a number of fields:
FTP is user name
X is the password field, which is hidden;
14 is the user's UID field, you can set up their own, do not and other users of the same UID, otherwise it will cause system security problems;
50 with the user group of GID, you can set their own, do not share with other user groups ftp GID, otherwise it will cause system-wide problems;
FTP User is a description field;
/var/ftp is the home directory of the FTP user and can be defined by itself;
/sbin/nologin This is the user login shell, this is also possible to define,/sbin/nologin said can not log on the system, the system virtual account (also known as pseudo user) is generally so set. For example, we change the FTP user's/sbin/nologin to/bin/bash, so that the FTP user can log on to the system as a real user via either local or Remote Tools ssh or Telnet. This is not safe for the system, if you think that a user does not have much need to log into the system, you can only give him the FTP account permissions, that is, only to give him the permissions of FTP, and not his shell set into/bin/bash, etc.;
Understanding of the FTP user group:
When we look at the/etc/group, we find something like this;
FTP:X:50:
/etc/group is the user group's management profile, which indicates that the user group ftp,x is a password segment and 50 is a GID; we know that the FTP user belongs to the FTP user group against the FTP line in/etc/passwd. The GID for the FTP user line is the same as the GID for the FTP user group;
2.2. Whether anonymous FTP users and FTP user groups can be deleted
Under normal circumstances it is not possible to remove the FTP user and the user group rows in/etc/passwd and/etc/group, because the FTP server is required to implement the FTP user management, in the default case.
Although cannot delete, but to/etc/passwd and/etc/group in the FTP user and the FTP user group some related things can modify, for example we can change the FTP user's home directory, also may change the FTP user's UID. The premise is that you have an understanding of user management, System user management is the basis of all applications, may be a novice Linux brothers do not understand the importance of user management, but slowly you will find this truth;
3, the installation of VSFTPD;
VSFTPD packages are available on the installation disk in the latest major distributions, you can install it with the package management tools provided by the appropriate distribution, and of course you'll find VSFTPD packages in the FTP mirrors of each major release, and you can also install them online using the software package's management tools; VSFTPD's software package is not big enough, it won't take long, two minutes will suffice; Because this is a beginner's tutorial, I highly recommend that you use the software provided by the distribution to install, do not recommend yourself to compile the source code package installation method;
If you are using a Fedora or redhat system, you can use the following command to install online;
[Root@localhost ~]# Yum Install vsftpd
If it is a Debian class system, you can use apt to install online;
[root@localhost ~]# apt-get Install vsftpd
If you are the RPM system, you can also find vsftpd-xxxx.rpm package through the rpm command to install;
[Root@localhost ~]# RPM-IVH vsftpd*.rpm
You can download the source package to install
For example, we download the 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 to add the following line to the last line of the configuration file;
Listen=yes
Source Package installation method, if your system is the 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]
VSFTPD run There are two modes, in the RPM package management system, mostly by Fedora/redhat development, for such a system has a xinted server; for non-RPM package management systems, there is generally no xinted this said. In order to ensure the unity of this document, we do not use the xinetd mode, but with the INITD operating mode to start and manage the server, that is, independent operation mode; As for what is xinted and inted mode, you can refer to the "Install server with VSFTPD Linux network"
Through the introduction above, I believe those beginners know the basic knowledge of vsftpd, I hope to help you!