source: server/major/vsftpd.xml@ a57b443

10.1 11.0 11.1 11.2 lazarus plabs/python-mods qt5new trunk upgradedb xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since a57b443 was a57b443, checked in by Bruce Dubbs <bdubbs@…>, 22 months ago

Tags and a minor format change.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@24303 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 10.5 KB
Line 
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>
34 The <application>vsftpd</application> package contains a very
35 secure and very small FTP daemon. This is useful for serving files
36 over a network.
37 </para>
38
39 &lfs101_checked;
40
41 <bridgehead renderas="sect3">Package Information</bridgehead>
42 <itemizedlist spacing="compact">
43 <listitem>
44 <para>
45 Download (HTTP): <ulink url="&vsftpd-download-http;"/>
46 </para>
47 </listitem>
48 <listitem>
49 <para>
50 Download (FTP): <ulink url="&vsftpd-download-ftp;"/>
51 </para>
52 </listitem>
53 <listitem>
54 <para>
55 Download MD5 sum: &vsftpd-md5sum;
56 </para>
57 </listitem>
58 <listitem>
59 <para>
60 Download size: &vsftpd-size;
61 </para>
62 </listitem>
63 <listitem>
64 <para>
65 Estimated disk space required: &vsftpd-buildsize;
66 </para>
67 </listitem>
68 <listitem>
69 <para>
70 Estimated build time: &vsftpd-time;
71 </para>
72 </listitem>
73 </itemizedlist>
74
75 <bridgehead renderas="sect3">vsftpd Dependencies</bridgehead>
76
77 <bridgehead renderas="sect4">Required</bridgehead>
78 <para role="required">
79 <xref linkend="libnsl"/>
80 </para>
81
82 <bridgehead renderas="sect4">Recommended</bridgehead>
83 <para role="recommended">
84 <xref linkend="linux-pam"/>
85 </para>
86
87 <bridgehead renderas="sect4">Optional</bridgehead>
88 <para role="optional">
89 <xref linkend="libcap-pam"/>
90 </para>
91
92 <para condition="html" role="usernotes">User Notes:
93 <ulink url="&blfs-wiki;/vsftpd"/></para>
94
95 </sect2>
96
97 <sect2 role="installation">
98 <title>Installation of vsftpd</title>
99
100 <para>
101 For security reasons, running <application>vsftpd</application>
102 as an unprivileged user and group is encouraged. Also, a user should be
103 created to map anonymous users. As the <systemitem
104 class="username">root</systemitem> user, create the needed directories,
105 users, and groups with the following commands:
106 </para>
107
108<screen role="root"><userinput>install -v -d -m 0755 &vsftpd-empty; &amp;&amp;
109install -v -d -m 0755 /home/ftp &amp;&amp;
110groupadd -g 47 vsftpd &amp;&amp;
111groupadd -g 45 ftp &amp;&amp;
112
113useradd -c "vsftpd User" -d /dev/null -g vsftpd -s /bin/false -u 47 vsftpd &amp;&amp;
114useradd -c anonymous_user -d /home/ftp -g ftp -s /bin/false -u 45 ftp</userinput></screen>
115
116 <para>
117 Gcc-10 and later flags an error for an implicit type cast. Make it
118 explicit:
119 </para>
120
121<screen><userinput>sed -e "s/kVSFSysStrOpenUnknown;/(enum EVSFSysUtilOpenMode)&amp;/" -i sysstr.c</userinput></screen>
122
123 <para>
124 Build <application>vsftpd</application> as an unprivileged user
125 using the following command:
126 </para>
127
128<screen><userinput>make</userinput></screen>
129
130 <para>
131 This package does not come with a test suite.
132 </para>
133
134 <para>
135 Once again, become the <systemitem class="username">root</systemitem>
136 user and install <application>vsftpd</application> with the following
137 commands:
138 </para>
139
140<screen role="root"><userinput>install -v -m 755 vsftpd /usr/sbin/vsftpd &amp;&amp;
141install -v -m 644 vsftpd.8 /usr/share/man/man8 &amp;&amp;
142install -v -m 644 vsftpd.conf.5 /usr/share/man/man5 &amp;&amp;
143install -v -m 644 vsftpd.conf /etc</userinput></screen>
144
145 </sect2>
146
147 <sect2 role="commands">
148 <title>Command Explanations</title>
149
150 <para>
151 <command>install -v -d ...</command>: This creates the
152 directory that anonymous users will use (<filename
153 class='directory'>/home/ftp</filename>)
154 and the directory the daemon will chroot into
155 (<filename class='directory'>&vsftpd-empty;</filename>).
156 </para>
157
158 <note>
159 <para>
160 <filename class="directory">/home/ftp</filename> should not be
161 owned by the user <systemitem class="username">vsftpd</systemitem>,
162 or the user <systemitem class="username">ftp</systemitem>.
163 </para>
164 </note>
165
166 <para>
167 <command>echo "#define VSF_BUILD_TCPWRAPPERS" >>builddefs.h</command>:
168 Use this prior to <command>make</command> to add support for
169 <application>tcpwrappers</application>.
170 </para>
171
172 <para>
173 <command>echo "#define VSF_BUILD_SSL" >>builddefs.h</command>:
174 Use this prior to <command>make</command> to add support for SSL.
175 </para>
176
177 <para>
178 <command>install -v -m ...</command>:
179 The <filename>Makefile</filename> uses non-standard installation paths.
180 These commands install the files in
181 <filename class='directory'>/usr</filename> and
182 <filename class='directory'>/etc</filename>.
183 </para>
184
185 </sect2>
186
187 <sect2 role="configuration">
188 <title>Configuring vsftpd</title>
189
190 <sect3 id="vsftpd-config">
191 <title>Config Files</title>
192
193 <para>
194 <filename>/etc/vsftpd.conf</filename>
195 </para>
196
197 <indexterm zone="vsftpd vsftpd-config">
198 <primary sortas="e-etc-vsftpd.conf">/etc/vsftpd.conf</primary>
199 </indexterm>
200
201 </sect3>
202
203 <sect3>
204 <title>Configuration Information</title>
205
206 <para>
207 <application>vsftpd</application> comes with a basic
208 anonymous-only configuration file that was copied to
209 <filename class='directory'>/etc</filename> above. While still as
210 <systemitem class="username">root</systemitem>, this file should be
211 modified because it is now recommended to run <command>vsftpd</command>
212 in standalone mode. Also, you
213 should specify the privilege separation user created above. Finally,
214 you should specify the <command>chroot</command> directory.
215 <command>man vsftpd.conf</command> will give you all the details.
216 </para>
217
218<screen role="root"><userinput>cat &gt;&gt; /etc/vsftpd.conf &lt;&lt; "EOF"
219<literal>background=YES
220listen=YES
221nopriv_user=vsftpd
222secure_chroot_dir=&vsftpd-empty;</literal>
223EOF</userinput></screen>
224
225 <!-- recheck this issue when vsftpd is updated -->
226 <para>
227 The vsftpd daemon uses seccomp to improve security by default.
228 But it's known to cause vsftpd unable to handle ftp
229 <literal>LIST</literal> command with recent kernel versions. Append
230 a line to <filename>/etc/vsftpd.conf</filename> (as the
231 <systemitem class="username">root</systemitem> user) to disable
232 seccomp and workaround this issue:
233 </para>
234
235<screen role="root"><userinput>cat &gt;&gt; /etc/vsftpd.conf &lt;&lt; "EOF"
236<literal>seccomp_sandbox=NO</literal>
237EOF</userinput></screen>
238
239 <para>
240 To enable local logins, append the following to the
241 <filename>/etc/vsftpd.conf</filename> file (as the
242 <systemitem class="username">root</systemitem> user):
243 </para>
244
245<screen role="root"><userinput>cat &gt;&gt; /etc/vsftpd.conf &lt;&lt; "EOF"
246<literal>local_enable=YES</literal>
247EOF</userinput></screen>
248
249 <para>
250 In addition, if using <application>Linux-PAM</application> and
251 <application>vsftpd</application> with local user logins, you will need
252 a <application>Linux-PAM</application> configuration file. As the
253 <systemitem class="username">root</systemitem> user, create the
254 <filename>/etc/pam.d/vsftpd</filename> file, and add the needed
255 configuration changes for <application>Linux-PAM</application> session
256 support using the following commands:
257 </para>
258
259<screen role="root"><userinput>cat &gt; /etc/pam.d/vsftpd &lt;&lt; "EOF" &amp;&amp;
260<literal># Begin /etc/pam.d/vsftpd
261auth required /lib/security/pam_listfile.so item=user sense=deny \
262 file=/etc/ftpusers \
263 onerr=succeed
264auth required pam_shells.so
265auth include system-auth
266account include system-account
267session include system-session</literal>
268EOF
269
270cat &gt;&gt; /etc/vsftpd.conf &lt;&lt; "EOF"
271<literal>session_support=YES
272pam_service_name=vsftpd</literal>
273EOF</userinput></screen>
274
275 </sect3>
276
277 <sect3 id="vsftpd-init">
278 <title><phrase revision="sysv">Boot Script</phrase>
279 <phrase revision="systemd">Systemd Unit</phrase></title>
280
281 <para>
282 Install the
283 <phrase revision="sysv"><filename>/etc/rc.d/init.d/vsftpd</filename>
284 init script</phrase>
285 <phrase revision="systemd"><filename>vsftpd.service</filename>
286 unit</phrase> included in the
287 <xref linkend="bootscripts" revision="sysv"/>
288 <xref linkend="systemd-units" revision="systemd"/> package:
289 </para>
290
291<screen role="root"><userinput>make install-vsftpd</userinput></screen>
292
293 </sect3>
294
295 </sect2>
296
297 <sect2 role="content">
298 <title>Contents</title>
299
300 <segmentedlist>
301 <segtitle>Installed Program</segtitle>
302 <segtitle>Installed Libraries</segtitle>
303 <segtitle>Installed Directories</segtitle>
304
305 <seglistitem>
306 <seg>vsftpd</seg>
307 <seg>None</seg>
308 <seg>/usr/share/vsftpd, /home/ftp</seg>
309 </seglistitem>
310 </segmentedlist>
311
312 <variablelist>
313 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
314 <?dbfo list-presentation="list"?>
315 <?dbhtml list-presentation="table"?>
316
317 <varlistentry id="vsftpd-prog">
318 <term><command>vsftpd</command></term>
319 <listitem>
320 <para>
321 is the FTP daemon
322 </para>
323 <indexterm zone="vsftpd vsftpd-prog">
324 <primary sortas="b-vsftpd">vsftpd</primary>
325 </indexterm>
326 </listitem>
327 </varlistentry>
328
329 </variablelist>
330
331 </sect2>
332
333</sect1>
Note: See TracBrowser for help on using the repository browser.