source: server/major/vsftpd.xml@ ac84482

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since ac84482 was 4472e923, checked in by Pierre Labastie <pieere@…>, 4 years ago

Finish formatting the "server" chapter

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

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