1 This example should quickly show you the possibilites of per-IP configuration
2 with vsftpd's tcp_wrappers integration. This is new with v1.1.3.
4 To use this, you need vsftpd built with tcp_wrappers! This is accomplished
5 by editing "builddefs.h" and changing
7 #undef VSF_BUILD_TCPWRAPPERS
9 #define VSF_BUILD_TCPWRAPPERS
11 And then rebuild. If you are lucky your vendor will have shipped the vsftpd
12 binary with this already done for you.
14 Next, to enable tcp_wrappers integration, you need this in your vsftpd.conf:
18 And you'll need a tcp_wrappers config file. An example one is supplied in this
19 directory: hosts.allow. It lives at /etc/hosts.allow.
21 Let's have a look at the example:
23 vsftpd: 192.168.1.3: setenv VSFTPD_LOAD_CONF /etc/vsftpd_tcp_wrap.conf
24 vsftpd: 192.168.1.4: DENY
27 If a client connects from 192.168.1.3, then vsftpd will apply the vsftpd
28 config file /etc/vsftpd_tcp_wrap.conf to the session! These settings are
29 applied ON TOP of the default vsftpd.conf.
30 This is obviously very powerful. You might use this to apply different
31 access restrictions for some IPs (e.g. the ability to upload).
32 Or you could give certain classes of IPs the ability to skip connection
33 limits (max_clients=0).
34 Or you could increase / decrease the bandwidth limiter for certain classes
39 Denies the ability of 192.168.1.4 to connect. Very useful to take care of
40 troublemakers. And now you don't need xinetd to do it - hurrah.