1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY vsftpd-download-http "https://security.appspot.com/downloads/vsftpd-&vsftpd-version;.tar.gz">
|
---|
8 | <!ENTITY vsftpd-download-ftp " ">
|
---|
9 | <!ENTITY vsftpd-md5sum "da119d084bd3f98664636ea05b5bb398">
|
---|
10 | <!ENTITY vsftpd-size "196 KB">
|
---|
11 | <!ENTITY vsftpd-buildsize "2 MB">
|
---|
12 | <!ENTITY vsftpd-time "less than 0.1 SBU">
|
---|
13 | <!ENTITY vsftpd-empty "/usr/share/vsftpd/empty">
|
---|
14 | ]>
|
---|
15 |
|
---|
16 | <sect1 id="vsftpd" xreflabel="vsftpd-&vsftpd-version;">
|
---|
17 | <?dbhtml filename="vsftpd.html"?>
|
---|
18 |
|
---|
19 | <sect1info>
|
---|
20 | <othername>$LastChangedBy$</othername>
|
---|
21 | <date>$Date$</date>
|
---|
22 | </sect1info>
|
---|
23 |
|
---|
24 | <title>vsftpd-&vsftpd-version;</title>
|
---|
25 |
|
---|
26 | <indexterm zone="vsftpd">
|
---|
27 | <primary sortas="a-vsftpd">vsftpd</primary>
|
---|
28 | </indexterm>
|
---|
29 |
|
---|
30 | <sect2 role="package">
|
---|
31 | <title>Introduction to vsftpd</title>
|
---|
32 |
|
---|
33 | <para>The <application>vsftpd</application> package contains a very
|
---|
34 | secure and very small FTP daemon. This is useful for serving files
|
---|
35 | over a network.</para>
|
---|
36 |
|
---|
37 | &lfs83_checked;
|
---|
38 |
|
---|
39 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
40 | <itemizedlist spacing="compact">
|
---|
41 | <listitem>
|
---|
42 | <para>Download (HTTP): <ulink url="&vsftpd-download-http;"/></para>
|
---|
43 | </listitem>
|
---|
44 | <listitem>
|
---|
45 | <para>Download (FTP): <ulink url="&vsftpd-download-ftp;"/></para>
|
---|
46 | </listitem>
|
---|
47 | <listitem>
|
---|
48 | <para>Download MD5 sum: &vsftpd-md5sum;</para>
|
---|
49 | </listitem>
|
---|
50 | <listitem>
|
---|
51 | <para>Download size: &vsftpd-size;</para>
|
---|
52 | </listitem>
|
---|
53 | <listitem>
|
---|
54 | <para>Estimated disk space required: &vsftpd-buildsize;</para>
|
---|
55 | </listitem>
|
---|
56 | <listitem>
|
---|
57 | <para>Estimated build time: &vsftpd-time;</para>
|
---|
58 | </listitem>
|
---|
59 | </itemizedlist>
|
---|
60 |
|
---|
61 | <bridgehead renderas="sect3">vsftpd Dependencies</bridgehead>
|
---|
62 |
|
---|
63 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
64 | <para role="required">
|
---|
65 | <xref linkend="libnsl"/>
|
---|
66 | </para>
|
---|
67 |
|
---|
68 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
69 | <para role="optional">
|
---|
70 | <xref linkend="libcap-pam"/>, and
|
---|
71 | <xref linkend="linux-pam"/>
|
---|
72 | </para>
|
---|
73 |
|
---|
74 | <para condition="html" role="usernotes">User Notes:
|
---|
75 | <ulink url="&blfs-wiki;/vsftpd"/></para>
|
---|
76 |
|
---|
77 | </sect2>
|
---|
78 |
|
---|
79 | <sect2 role="installation">
|
---|
80 | <title>Installation of vsftpd</title>
|
---|
81 |
|
---|
82 | <para>For security reasons, running <application>vsftpd</application>
|
---|
83 | as an unprivileged user and group is encouraged. Also, a user should be
|
---|
84 | created to map anonymous users. As the <systemitem
|
---|
85 | class="username">root</systemitem> user, create the needed directories,
|
---|
86 | users, and groups with the following commands:</para>
|
---|
87 |
|
---|
88 | <screen role="root"><userinput>install -v -d -m 0755 &vsftpd-empty; &&
|
---|
89 | install -v -d -m 0755 /home/ftp &&
|
---|
90 | groupadd -g 47 vsftpd &&
|
---|
91 | groupadd -g 45 ftp &&
|
---|
92 |
|
---|
93 | useradd -c "vsftpd User" -d /dev/null -g vsftpd -s /bin/false -u 47 vsftpd &&
|
---|
94 | useradd -c anonymous_user -d /home/ftp -g ftp -s /bin/false -u 45 ftp</userinput></screen>
|
---|
95 | <!--
|
---|
96 | <para>If you did not install the optional <application>libcap2</application> package,
|
---|
97 | run the following to avoid a build error:</para>
|
---|
98 |
|
---|
99 | <screen><userinput>sed -i -e 's|#define VSF_SYSDEP_HAVE_LIBCAP|//&|' sysdeputil.c</userinput></screen>-->
|
---|
100 |
|
---|
101 | <para>Build <application>vsftpd</application> as an unprivileged user
|
---|
102 | using the following command:</para>
|
---|
103 |
|
---|
104 | <screen><userinput>make</userinput></screen>
|
---|
105 |
|
---|
106 | <para>This package does not come with a test suite.</para>
|
---|
107 |
|
---|
108 | <para>Once again, become the <systemitem class="username">root</systemitem>
|
---|
109 | user and install <application>vsftpd</application> with the following
|
---|
110 | commands:</para>
|
---|
111 |
|
---|
112 | <screen role="root"><userinput>install -v -m 755 vsftpd /usr/sbin/vsftpd &&
|
---|
113 | install -v -m 644 vsftpd.8 /usr/share/man/man8 &&
|
---|
114 | install -v -m 644 vsftpd.conf.5 /usr/share/man/man5 &&
|
---|
115 | install -v -m 644 vsftpd.conf /etc</userinput></screen>
|
---|
116 |
|
---|
117 | </sect2>
|
---|
118 |
|
---|
119 | <sect2 role="commands">
|
---|
120 | <title>Command Explanations</title>
|
---|
121 |
|
---|
122 | <para><command>install -v -d ...</command>: This creates the
|
---|
123 | directory that anonymous users will use (<filename
|
---|
124 | class='directory'>/home/ftp</filename>)
|
---|
125 | and the directory the daemon will chroot into
|
---|
126 | (<filename class='directory'>&vsftpd-empty;</filename>).</para>
|
---|
127 |
|
---|
128 | <note>
|
---|
129 | <para><filename class="directory">/home/ftp</filename> should not be
|
---|
130 | owned by the user <systemitem class="username">vsftpd</systemitem>,
|
---|
131 | or the user <systemitem class="username">ftp</systemitem>.</para>
|
---|
132 | </note>
|
---|
133 |
|
---|
134 | <para><command>echo "#define VSF_BUILD_TCPWRAPPERS" >>builddefs.h</command>:
|
---|
135 | Use this prior to <command>make</command> to add support for
|
---|
136 | <application>tcpwrappers</application>.</para>
|
---|
137 |
|
---|
138 | <para><command>echo "#define VSF_BUILD_SSL" >>builddefs.h</command>:
|
---|
139 | Use this prior to <command>make</command> to add support for SSL.</para>
|
---|
140 |
|
---|
141 | <para><command>install -v -m ...</command>:
|
---|
142 | The <filename>Makefile</filename> uses non-standard installation paths.
|
---|
143 | These commands install the files in
|
---|
144 | <filename class='directory'>/usr</filename> and
|
---|
145 | <filename class='directory'>/etc</filename>.</para>
|
---|
146 |
|
---|
147 | </sect2>
|
---|
148 |
|
---|
149 | <sect2 role="configuration">
|
---|
150 | <title>Configuring vsftpd</title>
|
---|
151 |
|
---|
152 | <sect3 id="vsftpd-config">
|
---|
153 | <title>Config Files</title>
|
---|
154 |
|
---|
155 | <para><filename>/etc/vsftpd.conf</filename></para>
|
---|
156 |
|
---|
157 | <indexterm zone="vsftpd vsftpd-config">
|
---|
158 | <primary sortas="e-etc-vsftpd.conf">/etc/vsftpd.conf</primary>
|
---|
159 | </indexterm>
|
---|
160 |
|
---|
161 | </sect3>
|
---|
162 |
|
---|
163 | <sect3>
|
---|
164 | <title>Configuration Information</title>
|
---|
165 |
|
---|
166 | <para><application>vsftpd</application> comes with a basic
|
---|
167 | anonymous-only configuration file that was copied to
|
---|
168 | <filename class='directory'>/etc</filename> above. While still as
|
---|
169 | <systemitem class="username">root</systemitem>, this file should be
|
---|
170 | modified because it is now recommended to run <command>vsftpd</command>
|
---|
171 | in standalone mode. <!-- as opposed to
|
---|
172 | <command>inetd</command>/<command>xinetd</command> mode. -->Also, you
|
---|
173 | should specify the privilege separation user created above. Finally,
|
---|
174 | you should specify the <command>chroot</command> directory.
|
---|
175 | <command>man vsftpd.conf</command> will give you all the details.</para>
|
---|
176 |
|
---|
177 | <screen role="root"><userinput>cat >> /etc/vsftpd.conf << "EOF"
|
---|
178 | <literal>background=YES
|
---|
179 | listen=YES
|
---|
180 | nopriv_user=vsftpd
|
---|
181 | secure_chroot_dir=&vsftpd-empty;</literal>
|
---|
182 | EOF</userinput></screen>
|
---|
183 |
|
---|
184 | <para>To enable local logins, append the following to the
|
---|
185 | <filename>/etc/vsftpd.conf</filename> file (as the
|
---|
186 | <systemitem class="username">root</systemitem> user):</para>
|
---|
187 |
|
---|
188 | <screen role="root"><userinput>cat >> /etc/vsftpd.conf << "EOF"
|
---|
189 | <literal>local_enable=YES</literal>
|
---|
190 | EOF</userinput></screen>
|
---|
191 |
|
---|
192 | <para>In addition, if using <application>Linux-PAM</application> and
|
---|
193 | <application>vsftpd</application> with local user logins, you will need
|
---|
194 | a <application>Linux-PAM</application> configuration file. As the
|
---|
195 | <systemitem class="username">root</systemitem> user, create the
|
---|
196 | <filename>/etc/pam.d/vsftpd</filename> file, and add the needed
|
---|
197 | configuration changes for <application>Linux-PAM</application> session
|
---|
198 | support using the following commands:</para>
|
---|
199 |
|
---|
200 | <screen role="root"><userinput>cat > /etc/pam.d/vsftpd << "EOF" &&
|
---|
201 | <literal># Begin /etc/pam.d/vsftpd
|
---|
202 | auth required /lib/security/pam_listfile.so item=user sense=deny \
|
---|
203 | file=/etc/ftpusers \
|
---|
204 | onerr=succeed
|
---|
205 | auth required pam_shells.so
|
---|
206 | auth include system-auth
|
---|
207 | account include system-account
|
---|
208 | session include system-session</literal>
|
---|
209 | EOF
|
---|
210 |
|
---|
211 | cat >> /etc/vsftpd.conf << "EOF"
|
---|
212 | <literal>session_support=YES
|
---|
213 | pam_service_name=vsftpd</literal>
|
---|
214 | EOF</userinput></screen>
|
---|
215 |
|
---|
216 | </sect3>
|
---|
217 |
|
---|
218 | <sect3 id="vsftpd-init">
|
---|
219 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
220 | <phrase revision="systemd">Systemd Unit</phrase></title>
|
---|
221 |
|
---|
222 | <para>Install the
|
---|
223 | <phrase revision="sysv"><filename>/etc/rc.d/init.d/vsftpd</filename> init
|
---|
224 | script</phrase>
|
---|
225 | <phrase revision="systemd"><filename>vsftpd.service</filename>
|
---|
226 | unit</phrase> included in the
|
---|
227 | <xref linkend="bootscripts" revision="sysv"/>
|
---|
228 | <xref linkend="systemd-units" revision="systemd"/> package.</para>
|
---|
229 |
|
---|
230 | <screen role="root"><userinput>make install-vsftpd</userinput></screen>
|
---|
231 |
|
---|
232 | </sect3>
|
---|
233 |
|
---|
234 | </sect2>
|
---|
235 |
|
---|
236 | <sect2 role="content">
|
---|
237 | <title>Contents</title>
|
---|
238 |
|
---|
239 | <segmentedlist>
|
---|
240 | <segtitle>Installed Program</segtitle>
|
---|
241 | <segtitle>Installed Libraries</segtitle>
|
---|
242 | <segtitle>Installed Directories</segtitle>
|
---|
243 |
|
---|
244 | <seglistitem>
|
---|
245 | <seg>vsftpd</seg>
|
---|
246 | <seg>None</seg>
|
---|
247 | <seg>/usr/share/vsftpd, /home/ftp</seg>
|
---|
248 | </seglistitem>
|
---|
249 | </segmentedlist>
|
---|
250 |
|
---|
251 | <variablelist>
|
---|
252 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
253 | <?dbfo list-presentation="list"?>
|
---|
254 | <?dbhtml list-presentation="table"?>
|
---|
255 |
|
---|
256 | <varlistentry id="vsftpd-prog">
|
---|
257 | <term><command>vsftpd</command></term>
|
---|
258 | <listitem>
|
---|
259 | <para>is the FTP daemon.</para>
|
---|
260 | <indexterm zone="vsftpd vsftpd-prog">
|
---|
261 | <primary sortas="b-vsftpd">vsftpd</primary>
|
---|
262 | </indexterm>
|
---|
263 | </listitem>
|
---|
264 | </varlistentry>
|
---|
265 |
|
---|
266 | </variablelist>
|
---|
267 |
|
---|
268 | </sect2>
|
---|
269 |
|
---|
270 | </sect1>
|
---|