vsFTPd Installation and Configuration
vsFTPD is a small, easy to use FTP server program, is a Linux distribution in the most respected in the FTP server program, is characterized by small, light, safe to use.
In the latest major release of the installation disk has vsFTPd package, provided with the appropriate distribution package management tools to install. Of course, can also go to the major release to find vsftpd FTP mirror package, with package management tools online installation. Recommended software provided with the distribution to install, is not recommended to compile the source package is installed.
Fedora or Redhat systems, you can use the following command-line installation;
[Root @ localhost ~] # yum install vsftpd
If it is debian like systems, you can use apt to install the line;
[Root @ localhost ~] # apt-get install vsftpd
If the RPM system, you can also find package vsftpd-xxxx.rpm through the rpm command to install;
[Root @ localhost ~] # rpm-ivh vsftpd *. rpm
Download Source Package installation
[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
And then modify / etc / vsftpd.conf, the last line in the configuration file add the following line;
listen = yes
Source package installation methods, if your system is RPM package management system, you can delete / etc / xinetd.d / vsftpd file; and then start the xinetd server;
[Root @ localhost ~] # / etc / init.d / xinetd restart
Stop xinetd: [OK]
Start xinetd: [OK]
vsFTPd server running
[Root @ localhost ~] # / usr / sbin / vsftpd &
[Root @ localhost ~] # / usr / local / sbin / vsftpd &
vsFTPd server down
To kill with pkill vsftpd vsftpd process, so put vsFTPd off, with psgrep vsftpd to view the process, if not the process, prove vsFTPd has closed; use to root privileges.
[Root @ localhost ~] # pkill vsftpd
[Root @ localhost ~] # pgrep vsftpd
In Fedora / Redhat / CentOS vsFTPd servers in the startup and shutdown:
In Fedora / Redhat / CentOS, you can also use the following method to start vsFTPd; of course need to use root privileges;
[Root @ localhost beinan] # / etc / init.d / vsftpd start
To vsftpd start vsftpd: [OK]
VsFTPd restart with the following command;
[Root @ localhost beinan] # / etc / init.d / vsftpd restart
Close vsftpd: [OK]
To vsftpd start vsftpd: [OK]
Off vsFTPd server, you should use the following command;
[Root @ localhost beinan] # / etc / init.d / vsftpd stop
Close vsftpd: [OK]
vsftpd.conf is vsFTPd server configuration file, this file is usually / etc / vsftpd.conf or / etc / vsftpd / vsftpd.conf, vsftpd.conf vsFTPd server configuration file is the global control file, this configuration file, each line should be counted as a rule. To be effective need to be restarted after configuration.
vsFTPd configure virtual users
FTP users can not log on the system generally, and this is for safety. In the system log user does not have permission generally known as a virtual user; virtual users is to be written into / etc / passwd in; this is just a method of virtual users, but said it's not really a virtual user just log SHELL his authority to remove, so he can not afford to sign-on system;
If we want to beinan the user directory located in / opt / beinan this directory, and can not log in; we should be as follows
[Root @ localhost ~] # adduser-d / opt / beinan-g ftp-s / sbin / nologin beinan
[Root @ localhost ~] # passwd beinan
Changing password for user beinan.
Retype new password:
passwd: all authentication tokens updated successfully.
[Root @ localhost ~] #
In fact, this is not enough, but also to change the configuration file vsftpd.conf, to ensure that the local virtual users to read and write permissions;
local_enable = YES
write_enable = YES
local_umask = 022
How to implement a virtual path?
/ Home / a map ftp://localhost/a
/ Home / b / c was ftp://localhost/c
Can be achieved by the following method.
[Root @ localhost ~] # mount-bind [the original directory] [new directory]
Such as my ftp default directory is / var / ftp, I want to / mnt / LinG / WinSoft folder mapped to the / var / ftp directory, and I as follows
We first in / var / ftp directory to build a directory
[Root @ localhost ~] # mkdir / var / ftp / WinSoft
And then run mount command
[Root @ localhost ~] # mount-bind / mnt / LinG / WinSoft / var / ftp / WinSoft
Open vsFTP server logging
The following xferlog_file out in front of the #, which is open to vsftp the log function, so that we can in / var / log directory View vsftpd.log. This is vsFTP log function, which for us is extremely important.
xferlog_file = / var / log / vsftpd.log
How to limit the number of links to vsFTP server, and the largest number of links for each IP?
Should change the server's configuration file vsFTPd vsftpd.conf, add the following two lines:
max_clients = number
max_per_ip = number
Example: I want my vsFTP maximum support to 100 the number of links, each IP, can support up to 5 links, so I should add vsftpd.conf following two lines:
max_clients = 100
max_per_ip = 5
How to limit the transfer speed?
anon_max_rate = number
Note: This is the speed of anonymous
local_max_rate = number
Note: This is vsFTP the speed of a local user on the server
Note: This unit is the number of byte, so we have to calculate. For example, I want anonymous users and vsFTP 80KB on users to download, so this figure should be 1024 × 80 = 81920
So we have to add in vsftpd.conf following two lines
anon_max_rate = 81920
local_max_rate = 81920