[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 |
|
---|
[32ccdf34] | 33 | <para>The <application>vsftpd</application> package contains a very
|
---|
[f8ff412] | 34 | secure and very small FTP daemon. This is useful for serving files
|
---|
| 35 | over a network.</para>
|
---|
| 36 |
|
---|
[443b085] | 37 | &lfs80_checked;
|
---|
[5f2eb36] | 38 |
|
---|
[f8ff412] | 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 |
|
---|
[32ccdf34] | 61 | <bridgehead renderas="sect3">vsftpd Dependencies</bridgehead>
|
---|
[f8ff412] | 62 |
|
---|
| 63 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[e79ed72] | 64 | <para role="optional">
|
---|
[421e0cb2] | 65 | <xref linkend="libcap-pam"/>, and
|
---|
| 66 | <xref linkend="linux-pam"/>
|
---|
[e79ed72] | 67 | </para>
|
---|
[f8ff412] | 68 |
|
---|
[3cb0c57] | 69 | <para condition="html" role="usernotes">User Notes:
|
---|
| 70 | <ulink url="&blfs-wiki;/vsftpd"/></para>
|
---|
| 71 |
|
---|
[f8ff412] | 72 | </sect2>
|
---|
| 73 |
|
---|
| 74 | <sect2 role="installation">
|
---|
[32ccdf34] | 75 | <title>Installation of vsftpd</title>
|
---|
[f8ff412] | 76 |
|
---|
[32ccdf34] | 77 | <para>For security reasons, running <application>vsftpd</application>
|
---|
[939e5f5] | 78 | as an unprivileged user and group is encouraged. Also, a user should be
|
---|
| 79 | created to map anonymous users. As the <systemitem
|
---|
| 80 | class="username">root</systemitem> user, create the needed directories,
|
---|
| 81 | users, and groups with the following commands:</para>
|
---|
[f8ff412] | 82 |
|
---|
[620b04a] | 83 | <screen role="root"><userinput>install -v -d -m 0755 &vsftpd-empty; &&
|
---|
| 84 | install -v -d -m 0755 /home/ftp &&
|
---|
| 85 | groupadd -g 47 vsftpd &&
|
---|
| 86 | groupadd -g 45 ftp &&
|
---|
[283bd88] | 87 |
|
---|
[5f2eb36] | 88 | useradd -c "vsftpd User" -d /dev/null -g vsftpd -s /bin/false -u 47 vsftpd &&
|
---|
| 89 | useradd -c anonymous_user -d /home/ftp -g ftp -s /bin/false -u 45 ftp</userinput></screen>
|
---|
[523c6e95] | 90 | <!--
|
---|
[5f2eb36] | 91 | <para>If you did not install the optional <application>libcap2</application> package,
|
---|
| 92 | run the following to avoid a build error:</para>
|
---|
| 93 |
|
---|
[523c6e95] | 94 | <screen><userinput>sed -i -e 's|#define VSF_SYSDEP_HAVE_LIBCAP|//&|' sysdeputil.c</userinput></screen>-->
|
---|
[d7c8734] | 95 |
|
---|
[32ccdf34] | 96 | <para>Build <application>vsftpd</application> as an unprivileged user
|
---|
[2bc0646] | 97 | using the following command:</para>
|
---|
[d7c8734] | 98 |
|
---|
[939e5f5] | 99 | <screen><userinput>make</userinput></screen>
|
---|
| 100 |
|
---|
[81d09ea] | 101 | <para>This package does not come with a test suite.</para>
|
---|
| 102 |
|
---|
[939e5f5] | 103 | <para>Once again, become the <systemitem class="username">root</systemitem>
|
---|
[32ccdf34] | 104 | user and install <application>vsftpd</application> with the following
|
---|
[939e5f5] | 105 | commands:</para>
|
---|
| 106 |
|
---|
[1c7e5c8a] | 107 | <screen role="root"><userinput>install -v -m 755 vsftpd /usr/sbin/vsftpd &&
|
---|
[5f2eb36] | 108 | install -v -m 644 vsftpd.8 /usr/share/man/man8 &&
|
---|
[f8ff412] | 109 | install -v -m 644 vsftpd.conf.5 /usr/share/man/man5 &&
|
---|
[5f2eb36] | 110 | install -v -m 644 vsftpd.conf /etc</userinput></screen>
|
---|
[d7c8734] | 111 |
|
---|
[f8ff412] | 112 | </sect2>
|
---|
[d7c8734] | 113 |
|
---|
[f8ff412] | 114 | <sect2 role="commands">
|
---|
| 115 | <title>Command Explanations</title>
|
---|
[d7c8734] | 116 |
|
---|
[2bc0646] | 117 | <para><command>install -v -d ...</command>: This creates the
|
---|
[f8ff412] | 118 | directory that anonymous users will use (<filename
|
---|
| 119 | class='directory'>/home/ftp</filename>)
|
---|
| 120 | and the directory the daemon will chroot into
|
---|
[620b04a] | 121 | (<filename class='directory'>&vsftpd-empty;</filename>).</para>
|
---|
[d7c8734] | 122 |
|
---|
[f8ff412] | 123 | <note>
|
---|
| 124 | <para><filename class="directory">/home/ftp</filename> should not be
|
---|
| 125 | owned by the user <systemitem class="username">vsftpd</systemitem>,
|
---|
| 126 | or the user <systemitem class="username">ftp</systemitem>.</para>
|
---|
| 127 | </note>
|
---|
[d7c8734] | 128 |
|
---|
[2bc0646] | 129 | <para><command>echo "#define VSF_BUILD_TCPWRAPPERS" >>builddefs.h</command>:
|
---|
[f8ff412] | 130 | Use this prior to <command>make</command> to add support for
|
---|
| 131 | <application>tcpwrappers</application>.</para>
|
---|
[d7c8734] | 132 |
|
---|
[2bc0646] | 133 | <para><command>echo "#define VSF_BUILD_SSL" >>builddefs.h</command>:
|
---|
[f8ff412] | 134 | Use this prior to <command>make</command> to add support for SSL.</para>
|
---|
[d7c8734] | 135 |
|
---|
[2bc0646] | 136 | <para><command>install -v -m ...</command>:
|
---|
| 137 | The <filename>Makefile</filename> uses non-standard installation paths.
|
---|
| 138 | These commands install the files in
|
---|
| 139 | <filename class='directory'>/usr</filename> and
|
---|
| 140 | <filename class='directory'>/etc</filename>.</para>
|
---|
[d7c8734] | 141 |
|
---|
[f8ff412] | 142 | </sect2>
|
---|
[d7c8734] | 143 |
|
---|
[f8ff412] | 144 | <sect2 role="configuration">
|
---|
[32ccdf34] | 145 | <title>Configuring vsftpd</title>
|
---|
[d7c8734] | 146 |
|
---|
[f8ff412] | 147 | <sect3 id="vsftpd-config">
|
---|
| 148 | <title>Config Files</title>
|
---|
[1586494] | 149 |
|
---|
[f8ff412] | 150 | <para><filename>/etc/vsftpd.conf</filename></para>
|
---|
[d7c8734] | 151 |
|
---|
[f8ff412] | 152 | <indexterm zone="vsftpd vsftpd-config">
|
---|
| 153 | <primary sortas="e-etc-vsftpd.conf">/etc/vsftpd.conf</primary>
|
---|
| 154 | </indexterm>
|
---|
[d7c8734] | 155 |
|
---|
[f8ff412] | 156 | </sect3>
|
---|
[d7c8734] | 157 |
|
---|
[f8ff412] | 158 | <sect3>
|
---|
| 159 | <title>Configuration Information</title>
|
---|
[d7c8734] | 160 |
|
---|
[32ccdf34] | 161 | <para><application>vsftpd</application> comes with a basic
|
---|
[f8ff412] | 162 | anonymous-only configuration file that was copied to
|
---|
[939e5f5] | 163 | <filename class='directory'>/etc</filename> above. While still as
|
---|
| 164 | <systemitem class="username">root</systemitem>, this file should be
|
---|
[f8ff412] | 165 | modified because it is now recommended to run <command>vsftpd</command>
|
---|
[59048cd9] | 166 | in standalone mode. <!-- as opposed to
|
---|
| 167 | <command>inetd</command>/<command>xinetd</command> mode. -->Also, you
|
---|
[f8ff412] | 168 | should specify the privilege separation user created above. Finally,
|
---|
| 169 | you should specify the <command>chroot</command> directory.
|
---|
| 170 | <command>man vsftpd.conf</command> will give you all the details.</para>
|
---|
| 171 |
|
---|
| 172 | <screen role="root"><userinput>cat >> /etc/vsftpd.conf << "EOF"
|
---|
| 173 | <literal>background=YES
|
---|
[d7c8734] | 174 | listen=YES
|
---|
| 175 | nopriv_user=vsftpd
|
---|
[620b04a] | 176 | secure_chroot_dir=&vsftpd-empty;</literal>
|
---|
[ee92087f] | 177 | EOF</userinput></screen>
|
---|
| 178 |
|
---|
| 179 | <para>To enable local logins, append the following to the
|
---|
| 180 | <filename>/etc/vsftpd.conf</filename> file (as the
|
---|
| 181 | <systemitem class="username">root</systemitem> user):</para>
|
---|
| 182 |
|
---|
[1dd7b0ae] | 183 | <screen role="root"><userinput>cat >> /etc/vsftpd.conf << "EOF"
|
---|
[ee92087f] | 184 | <literal>local_enable=YES</literal>
|
---|
| 185 | EOF</userinput></screen>
|
---|
| 186 |
|
---|
[1dd7b0ae] | 187 | <para>In addition, if using <application>Linux-PAM</application> and
|
---|
[ee92087f] | 188 | <application>vsftpd</application> with local user logins, you will need
|
---|
| 189 | a <application>Linux-PAM</application> configuration file. As the
|
---|
| 190 | <systemitem class="username">root</systemitem> user, create the
|
---|
| 191 | <filename>/etc/pam.d/vsftpd</filename> file, and add the needed
|
---|
| 192 | configuration changes for <application>Linux-PAM</application> session
|
---|
| 193 | support using the following commands:</para>
|
---|
| 194 |
|
---|
[1dd7b0ae] | 195 | <screen role="root"><userinput>cat > /etc/pam.d/vsftpd << "EOF" &&
|
---|
[ee92087f] | 196 | <literal># Begin /etc/pam.d/vsftpd
|
---|
| 197 | auth required /lib/security/pam_listfile.so item=user sense=deny \
|
---|
| 198 | file=/etc/ftpusers \
|
---|
| 199 | onerr=succeed
|
---|
| 200 | auth required pam_shells.so
|
---|
| 201 | auth include system-auth
|
---|
| 202 | account include system-account
|
---|
| 203 | session include system-session</literal>
|
---|
| 204 | EOF
|
---|
| 205 |
|
---|
| 206 | cat >> /etc/vsftpd.conf << "EOF"
|
---|
| 207 | <literal>session_support=YES
|
---|
| 208 | pam_service_name=vsftpd</literal>
|
---|
[f8ff412] | 209 | EOF</userinput></screen>
|
---|
[d7c8734] | 210 |
|
---|
[f8ff412] | 211 | </sect3>
|
---|
[d7c8734] | 212 |
|
---|
[f8ff412] | 213 | <sect3 id="vsftpd-init">
|
---|
[ee92087f] | 214 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
| 215 | <phrase revision="systemd">Systemd Unit</phrase></title>
|
---|
| 216 |
|
---|
[1258125] | 217 | <para>Install the
|
---|
| 218 | <phrase revision="sysv"><filename>/etc/rc.d/init.d/vsftpd</filename> init
|
---|
| 219 | script</phrase>
|
---|
| 220 | <phrase revision="systemd"><filename>vsftpd.service</filename>
|
---|
| 221 | unit</phrase> included in the
|
---|
| 222 | <xref linkend="bootscripts" revision="sysv"/>
|
---|
[3c7bd00] | 223 | <xref linkend="systemd-units" revision="systemd"/> package.</para>
|
---|
[d7c8734] | 224 |
|
---|
[f8ff412] | 225 | <screen role="root"><userinput>make install-vsftpd</userinput></screen>
|
---|
[d7c8734] | 226 |
|
---|
[f8ff412] | 227 | </sect3>
|
---|
[d7c8734] | 228 |
|
---|
[f8ff412] | 229 | </sect2>
|
---|
[d7c8734] | 230 |
|
---|
[f8ff412] | 231 | <sect2 role="content">
|
---|
| 232 | <title>Contents</title>
|
---|
[d7c8734] | 233 |
|
---|
[f8ff412] | 234 | <segmentedlist>
|
---|
| 235 | <segtitle>Installed Program</segtitle>
|
---|
| 236 | <segtitle>Installed Libraries</segtitle>
|
---|
| 237 | <segtitle>Installed Directories</segtitle>
|
---|
| 238 |
|
---|
| 239 | <seglistitem>
|
---|
| 240 | <seg>vsftpd</seg>
|
---|
| 241 | <seg>None</seg>
|
---|
[523c6e95] | 242 | <seg>/usr/share/vsftpd, /home/ftp</seg>
|
---|
[f8ff412] | 243 | </seglistitem>
|
---|
| 244 | </segmentedlist>
|
---|
| 245 |
|
---|
| 246 | <variablelist>
|
---|
| 247 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 248 | <?dbfo list-presentation="list"?>
|
---|
| 249 | <?dbhtml list-presentation="table"?>
|
---|
[d7c8734] | 250 |
|
---|
[f8ff412] | 251 | <varlistentry id="vsftpd-prog">
|
---|
| 252 | <term><command>vsftpd</command></term>
|
---|
| 253 | <listitem>
|
---|
| 254 | <para>is the FTP daemon.</para>
|
---|
| 255 | <indexterm zone="vsftpd vsftpd-prog">
|
---|
| 256 | <primary sortas="b-vsftpd">vsftpd</primary>
|
---|
| 257 | </indexterm>
|
---|
| 258 | </listitem>
|
---|
| 259 | </varlistentry>
|
---|
| 260 |
|
---|
| 261 | </variablelist>
|
---|
| 262 |
|
---|
| 263 | </sect2>
|
---|
| 264 |
|
---|
| 265 | </sect1>
|
---|