1
For now, just type "make" and mail me if it doesn't build.
3
Once built, you will need to run the binary from an inetd of some kind.
5
The FTP server will refuse to start up unless you satisfy a few prerequisites:
6
1) You will need the user "ftp" to exist and have a valid home directory.
7
2) You will need the user "nobody" to exist.
8
3) You will need an empty directory /usr/share/empty to exist.
10
Note that "ftp" "nobody" and "/usr/share/empty" are not hard-coded; you may
11
specify values for these in the config file.
4
This file details how to build and install / run vsftpd from the vsftpd
5
distribution .tar.gz file.
9
Switch to the directory created when you unpacked the vsftpd .tar.gz file.
14
edit "builddefs.h" to handle compile-time settings (tcp_wrappers build,
17
Just type "make" (and mail me to fix it if it doesn't build ;-).
18
This should produce you a vsftpd binary. You can test for this, e.g.:
20
[chris@localhost vsftpd]$ ls -l vsftpd
21
-rwxrwxr-x 1 chris chris 61748 Sep 27 00:26 vsftpd
23
Step 2) Satisfy vsftpd pre-requisites
24
2a) vsftpd needs the user "nobody" in the default configuration. Add this
25
user in case it does not already exist. e.g.:
27
[root@localhost root]# useradd nobody
28
useradd: user nobody exists
30
2b) vsftpd needs the (empty) directory /usr/share/empty in the default
31
configuration. Add this directory in case it does not already exist. e.g.:
33
[root@localhost root]# mkdir /usr/share/empty/
34
mkdir: cannot create directory `/usr/share/empty': File exists
36
2c) For anonymous FTP, you will need the user "ftp" to exist, and have a
37
valid home directory (which is NOT owned or writable by the user "ftp").
38
The following commands could be used to set up the user "ftp" if you do not
41
[root@localhost root]# mkdir /var/ftp/
42
[root@localhost root]# useradd -d /var/ftp ftp
44
(the next two are useful to run even if the user "ftp" already exists).
45
[root@localhost root]# chown root.root /var/ftp
46
[root@localhost root]# chmod og-w /var/ftp
48
Step 3) Install vsftpd config file, executable, man page, etc.
50
Running "make install" will try to copy the binary, man pages, etc. to
52
Or you might want to copy these things by hand, e.g.:
53
cp vsftpd /usr/local/sbin/vsftpd
54
cp vsftpd.conf.5 /usr/local/man/man5
55
cp vsftpd.8 /usr/local/man/man8
57
"make install" doesn't copy the sample config file. It is recommended you
61
Step 4) Smoke test (without an inetd).
63
vsftpd can run standalone or via an inetd (such as inetd or xinetd). You will
64
typically get more control running vsftpd from an inetd. But first we will run
65
it without, so we can check things are going well so far.
66
Edit /etc/vsftpd.conf, and add this line at the bottom:
70
This tells vsftpd it will NOT be running from inetd.
71
Right, now let's try and run it!
73
Make sure you are not running other FTP servers (or vsftpd will not be able
74
to use the FTP port, 21).
75
Run the binary from wherever you put it, e.g.:
77
[root@localhost root]# /usr/local/sbin/vsftpd &
80
If all is well, you can now connect! e.g.:
82
[chris@localhost chris]$ ftp localhost
83
Connected to localhost (127.0.0.1).
85
Name (localhost:chris): ftp
86
331 Please specify the password.
88
230 Login successful. Have fun.
89
Remote system type is UNIX.
90
Using binary mode to transfer files.
92
227 Entering Passive Mode (127,0,0,1,229,133)
93
150 Here comes the directory listing.
94
d--x--x--x 2 0 0 4096 Jan 14 2002 bin
95
d--x--x--x 2 0 0 4096 Apr 21 20:52 etc
96
drwxr-xr-x 2 0 0 4096 Apr 21 20:52 lib
97
drwxr-sr-x 2 0 50 4096 Jul 26 22:58 pub
98
226 Directory send OK.
101
Step 5) Run from an inetd of some kind (optional - standalone mode is now
104
You may want to run the binary from an inetd of some kind, because this can
105
give you extra features - e.g. xinetd has a lot of settings. (Note that
106
vsftpd's inbuilt listener covers most of the more useful xinetd settings).
108
5a) If using standard "inetd", you will need to edit /etc/inetd.conf, and add
111
ftp stream tcp nowait root /usr/sbin/tcpd /usr/local/sbin/vsftpd
113
(Make sure to remove or comment out any existing ftp service lines. If you
114
don't have tcp_wrappers installed, or don't want to use them, take out the
115
/usr/sbin/tcpd part).
117
inetd will need to be told to reload its config file:
118
kill -SIGHUP `pidof inetd`
120
5b) If using "xinetd", you can follow a provided example, by looking at the
121
file EXAMPLE/INTERNET_SITE/README. Various other examples show how to leverage
122
the more powerful xinetd features.
125
Step 6) Set up PAM for local logins (optional)
13
127
If you are running vsftpd on a PAM enabled machine, you will need to have a
14
128
/etc/pam.d/ftp file present, otherwise non-anonymous logins will fail. [NOTE -
15
129
if you have an older version of PAM, that file might be /etc/pam.conf]
131
For a standard setup, you can just copy a provided example file:
132
cp RedHat/vsftpd.pam /etc/pam.d/ftp
135
Step 7) Customize your configuration
17
137
As well as the above three pre-requisites, you are recommended to install a
18
138
config file. The default location for the config file is /etc/vsftpd.conf.
19
139
There is a sample vsftpd.conf in the distribution tarball. You probably want
20
to copy that to /etc/vsftpd.conf as a basis for modification. For example,
21
the default configuration allows neither local user logins nor anonymous
140
to copy that to /etc/vsftpd.conf as a basis for modification, i.e.:
144
The default configuration allows neither local user logins nor anonymous
22
145
uploads. You may wish to change these defaults.
24
If you have virtual hosting running, you may find it useful to specify the
25
config file on the command line. This is accomplished by specifying a single
26
command line argument which is a pathname to the config file. If using inetd
27
as opposed to xinetd, be careful to specify the program name argv[0] before
28
the config file location argv[1]!
30
150
Tested platforms (well, it builds)
35
- Solaris 8 / GNU tools (light testing)
42
- HP-UX 11.11 / GNU tools
43
- HP-UX 10.20 / GNU tools
45
- IRIX 6.5.11 / GNU tools
151
- Any modern, well featured platform should work fine! Recent versions of
152
the platforms listed below, and often older ones, should work fine.
154
- RedHat Enterprise Linux
155
- Solaris / GNU tools (Solaris 8 or newer)
163
- Mac OS X (note; older versions have setgroups() problem. 10.3.4 reported OK)