~ubuntu-branches/ubuntu/lucid/vsftpd/lucid-201001052349

« back to all changes in this revision

Viewing changes to INSTALL

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2005-03-23 15:52:34 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050323155234-00xobn5vcl0nwozg
Tags: 2.0.1-1ubuntu1
pretty init scriptage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
For now, just type "make" and mail me if it doesn't build.
2
 
 
3
 
Once built, you will need to run the binary from an inetd of some kind.
4
 
 
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.
9
 
 
10
 
Note that "ftp" "nobody" and "/usr/share/empty" are not hard-coded; you may
11
 
specify values for these in the config file.
 
1
INSTALL
 
2
=======
 
3
 
 
4
This file details how to build and install / run vsftpd from the vsftpd
 
5
distribution .tar.gz file.
 
6
 
 
7
Step 1) Build vsftpd.
 
8
 
 
9
Switch to the directory created when you unpacked the vsftpd .tar.gz file.
 
10
e.g.:
 
11
 
 
12
cd vsftpd-1.1.2
 
13
 
 
14
edit "builddefs.h" to handle compile-time settings (tcp_wrappers build,
 
15
etc).
 
16
 
 
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.:
 
19
 
 
20
[chris@localhost vsftpd]$ ls -l vsftpd
 
21
-rwxrwxr-x    1 chris    chris       61748 Sep 27 00:26 vsftpd
 
22
 
 
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.:
 
26
 
 
27
[root@localhost root]# useradd nobody
 
28
useradd: user nobody exists
 
29
 
 
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.:
 
32
 
 
33
[root@localhost root]# mkdir /usr/share/empty/
 
34
mkdir: cannot create directory `/usr/share/empty': File exists
 
35
 
 
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
 
39
have one:
 
40
 
 
41
[root@localhost root]# mkdir /var/ftp/
 
42
[root@localhost root]# useradd -d /var/ftp ftp
 
43
 
 
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
 
47
 
 
48
Step 3) Install vsftpd config file, executable, man page, etc.
 
49
 
 
50
Running "make install" will try to copy the binary, man pages, etc. to
 
51
somewhere sensible.
 
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
 
56
 
 
57
"make install" doesn't copy the sample config file. It is recommended you
 
58
do this:
 
59
cp vsftpd.conf /etc
 
60
 
 
61
Step 4) Smoke test (without an inetd).
 
62
 
 
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:
 
67
 
 
68
listen=YES
 
69
 
 
70
This tells vsftpd it will NOT be running from inetd.
 
71
Right, now let's try and run it!
 
72
Log in as root.
 
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.:
 
76
 
 
77
[root@localhost root]# /usr/local/sbin/vsftpd &
 
78
[1] 2104
 
79
 
 
80
If all is well, you can now connect! e.g.:
 
81
 
 
82
[chris@localhost chris]$ ftp localhost
 
83
Connected to localhost (127.0.0.1).
 
84
220 (vsFTPd 1.1.1)
 
85
Name (localhost:chris): ftp
 
86
331 Please specify the password.
 
87
Password:
 
88
230 Login successful. Have fun.
 
89
Remote system type is UNIX.
 
90
Using binary mode to transfer files.
 
91
ftp> ls
 
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.
 
99
ftp>
 
100
 
 
101
Step 5) Run from an inetd of some kind (optional - standalone mode is now
 
102
recommended)
 
103
 
 
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).
 
107
 
 
108
5a) If using standard "inetd", you will need to edit /etc/inetd.conf, and add
 
109
a line such as:
 
110
 
 
111
ftp stream tcp nowait root /usr/sbin/tcpd /usr/local/sbin/vsftpd
 
112
 
 
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).
 
116
 
 
117
inetd will need to be told to reload its config file:
 
118
kill -SIGHUP `pidof inetd`
 
119
 
 
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.
 
123
 
 
124
 
 
125
Step 6) Set up PAM for local logins (optional)
12
126
 
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]
16
130
 
 
131
For a standard setup, you can just copy a provided example file:
 
132
cp RedHat/vsftpd.pam /etc/pam.d/ftp
 
133
 
 
134
 
 
135
Step 7) Customize your configuration
 
136
 
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.:
 
141
 
 
142
cp vsftpd.conf /etc
 
143
 
 
144
The default configuration allows neither local user logins nor anonymous
22
145
uploads. You may wish to change these defaults.
23
146
 
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]!
 
147
Other notes
 
148
===========
29
149
 
30
150
Tested platforms (well, it builds)
31
 
- RedHat Linux 7.0
32
 
- RedHat Linux 6.1
33
 
- RedHat Linux 6.2
34
 
- RedHat Linux 5.2
35
 
- Solaris 8 / GNU tools (light testing)
36
 
- SuSE 6.4
37
 
- SuSE 6.0
38
 
- Debian 2.2
39
 
- OpenBSD 2.8
40
 
- FreeBSD 4.2
41
 
- FreeBSD 3.5
42
 
- HP-UX 11.11 / GNU tools
43
 
- HP-UX 10.20 / GNU tools
44
 
- Solaris 2.6
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.
 
153
- RedHat Linux
 
154
- RedHat Enterprise Linux
 
155
- Solaris / GNU tools (Solaris 8 or newer)
 
156
- SuSE Linux
 
157
- Debian Linux
 
158
- OpenBSD
 
159
- FreeBSD
 
160
- NetBSD
 
161
- HP-UX / GNU tools
 
162
- IRIX / GNU tools
 
163
- Mac OS X (note; older versions have setgroups() problem. 10.3.4 reported OK)
46
164