mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-24 23:32:12 +08:00
fa5ba12dab
Add libnsl as a required dependency of vsftpd. git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@19971 af4574ff-66df-0310-9fd7-8a98e5e911e0
271 lines
9.5 KiB
XML
271 lines
9.5 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
%general-entities;
|
|
|
|
<!ENTITY vsftpd-download-http "https://security.appspot.com/downloads/vsftpd-&vsftpd-version;.tar.gz">
|
|
<!ENTITY vsftpd-download-ftp " ">
|
|
<!ENTITY vsftpd-md5sum "da119d084bd3f98664636ea05b5bb398">
|
|
<!ENTITY vsftpd-size "196 KB">
|
|
<!ENTITY vsftpd-buildsize "2 MB">
|
|
<!ENTITY vsftpd-time "less than 0.1 SBU">
|
|
<!ENTITY vsftpd-empty "/usr/share/vsftpd/empty">
|
|
]>
|
|
|
|
<sect1 id="vsftpd" xreflabel="vsftpd-&vsftpd-version;">
|
|
<?dbhtml filename="vsftpd.html"?>
|
|
|
|
<sect1info>
|
|
<othername>$LastChangedBy$</othername>
|
|
<date>$Date$</date>
|
|
</sect1info>
|
|
|
|
<title>vsftpd-&vsftpd-version;</title>
|
|
|
|
<indexterm zone="vsftpd">
|
|
<primary sortas="a-vsftpd">vsftpd</primary>
|
|
</indexterm>
|
|
|
|
<sect2 role="package">
|
|
<title>Introduction to vsftpd</title>
|
|
|
|
<para>The <application>vsftpd</application> package contains a very
|
|
secure and very small FTP daemon. This is useful for serving files
|
|
over a network.</para>
|
|
|
|
&lfs82_checked;
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
<itemizedlist spacing="compact">
|
|
<listitem>
|
|
<para>Download (HTTP): <ulink url="&vsftpd-download-http;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download (FTP): <ulink url="&vsftpd-download-ftp;"/></para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download MD5 sum: &vsftpd-md5sum;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Download size: &vsftpd-size;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated disk space required: &vsftpd-buildsize;</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>Estimated build time: &vsftpd-time;</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<bridgehead renderas="sect3">vsftpd Dependencies</bridgehead>
|
|
|
|
<bridgehead renderas="sect4">Required</bridgehead>
|
|
<para role="required">
|
|
<xref linkend="libnsl"/>
|
|
</para>
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
|
<para role="optional">
|
|
<xref linkend="libcap-pam"/>, and
|
|
<xref linkend="linux-pam"/>
|
|
</para>
|
|
|
|
<para condition="html" role="usernotes">User Notes:
|
|
<ulink url="&blfs-wiki;/vsftpd"/></para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="installation">
|
|
<title>Installation of vsftpd</title>
|
|
|
|
<para>For security reasons, running <application>vsftpd</application>
|
|
as an unprivileged user and group is encouraged. Also, a user should be
|
|
created to map anonymous users. As the <systemitem
|
|
class="username">root</systemitem> user, create the needed directories,
|
|
users, and groups with the following commands:</para>
|
|
|
|
<screen role="root"><userinput>install -v -d -m 0755 &vsftpd-empty; &&
|
|
install -v -d -m 0755 /home/ftp &&
|
|
groupadd -g 47 vsftpd &&
|
|
groupadd -g 45 ftp &&
|
|
|
|
useradd -c "vsftpd User" -d /dev/null -g vsftpd -s /bin/false -u 47 vsftpd &&
|
|
useradd -c anonymous_user -d /home/ftp -g ftp -s /bin/false -u 45 ftp</userinput></screen>
|
|
<!--
|
|
<para>If you did not install the optional <application>libcap2</application> package,
|
|
run the following to avoid a build error:</para>
|
|
|
|
<screen><userinput>sed -i -e 's|#define VSF_SYSDEP_HAVE_LIBCAP|//&|' sysdeputil.c</userinput></screen>-->
|
|
|
|
<para>Build <application>vsftpd</application> as an unprivileged user
|
|
using the following command:</para>
|
|
|
|
<screen><userinput>make</userinput></screen>
|
|
|
|
<para>This package does not come with a test suite.</para>
|
|
|
|
<para>Once again, become the <systemitem class="username">root</systemitem>
|
|
user and install <application>vsftpd</application> with the following
|
|
commands:</para>
|
|
|
|
<screen role="root"><userinput>install -v -m 755 vsftpd /usr/sbin/vsftpd &&
|
|
install -v -m 644 vsftpd.8 /usr/share/man/man8 &&
|
|
install -v -m 644 vsftpd.conf.5 /usr/share/man/man5 &&
|
|
install -v -m 644 vsftpd.conf /etc</userinput></screen>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="commands">
|
|
<title>Command Explanations</title>
|
|
|
|
<para><command>install -v -d ...</command>: This creates the
|
|
directory that anonymous users will use (<filename
|
|
class='directory'>/home/ftp</filename>)
|
|
and the directory the daemon will chroot into
|
|
(<filename class='directory'>&vsftpd-empty;</filename>).</para>
|
|
|
|
<note>
|
|
<para><filename class="directory">/home/ftp</filename> should not be
|
|
owned by the user <systemitem class="username">vsftpd</systemitem>,
|
|
or the user <systemitem class="username">ftp</systemitem>.</para>
|
|
</note>
|
|
|
|
<para><command>echo "#define VSF_BUILD_TCPWRAPPERS" >>builddefs.h</command>:
|
|
Use this prior to <command>make</command> to add support for
|
|
<application>tcpwrappers</application>.</para>
|
|
|
|
<para><command>echo "#define VSF_BUILD_SSL" >>builddefs.h</command>:
|
|
Use this prior to <command>make</command> to add support for SSL.</para>
|
|
|
|
<para><command>install -v -m ...</command>:
|
|
The <filename>Makefile</filename> uses non-standard installation paths.
|
|
These commands install the files in
|
|
<filename class='directory'>/usr</filename> and
|
|
<filename class='directory'>/etc</filename>.</para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="configuration">
|
|
<title>Configuring vsftpd</title>
|
|
|
|
<sect3 id="vsftpd-config">
|
|
<title>Config Files</title>
|
|
|
|
<para><filename>/etc/vsftpd.conf</filename></para>
|
|
|
|
<indexterm zone="vsftpd vsftpd-config">
|
|
<primary sortas="e-etc-vsftpd.conf">/etc/vsftpd.conf</primary>
|
|
</indexterm>
|
|
|
|
</sect3>
|
|
|
|
<sect3>
|
|
<title>Configuration Information</title>
|
|
|
|
<para><application>vsftpd</application> comes with a basic
|
|
anonymous-only configuration file that was copied to
|
|
<filename class='directory'>/etc</filename> above. While still as
|
|
<systemitem class="username">root</systemitem>, this file should be
|
|
modified because it is now recommended to run <command>vsftpd</command>
|
|
in standalone mode. <!-- as opposed to
|
|
<command>inetd</command>/<command>xinetd</command> mode. -->Also, you
|
|
should specify the privilege separation user created above. Finally,
|
|
you should specify the <command>chroot</command> directory.
|
|
<command>man vsftpd.conf</command> will give you all the details.</para>
|
|
|
|
<screen role="root"><userinput>cat >> /etc/vsftpd.conf << "EOF"
|
|
<literal>background=YES
|
|
listen=YES
|
|
nopriv_user=vsftpd
|
|
secure_chroot_dir=&vsftpd-empty;</literal>
|
|
EOF</userinput></screen>
|
|
|
|
<para>To enable local logins, append the following to the
|
|
<filename>/etc/vsftpd.conf</filename> file (as the
|
|
<systemitem class="username">root</systemitem> user):</para>
|
|
|
|
<screen role="root"><userinput>cat >> /etc/vsftpd.conf << "EOF"
|
|
<literal>local_enable=YES</literal>
|
|
EOF</userinput></screen>
|
|
|
|
<para>In addition, if using <application>Linux-PAM</application> and
|
|
<application>vsftpd</application> with local user logins, you will need
|
|
a <application>Linux-PAM</application> configuration file. As the
|
|
<systemitem class="username">root</systemitem> user, create the
|
|
<filename>/etc/pam.d/vsftpd</filename> file, and add the needed
|
|
configuration changes for <application>Linux-PAM</application> session
|
|
support using the following commands:</para>
|
|
|
|
<screen role="root"><userinput>cat > /etc/pam.d/vsftpd << "EOF" &&
|
|
<literal># Begin /etc/pam.d/vsftpd
|
|
auth required /lib/security/pam_listfile.so item=user sense=deny \
|
|
file=/etc/ftpusers \
|
|
onerr=succeed
|
|
auth required pam_shells.so
|
|
auth include system-auth
|
|
account include system-account
|
|
session include system-session</literal>
|
|
EOF
|
|
|
|
cat >> /etc/vsftpd.conf << "EOF"
|
|
<literal>session_support=YES
|
|
pam_service_name=vsftpd</literal>
|
|
EOF</userinput></screen>
|
|
|
|
</sect3>
|
|
|
|
<sect3 id="vsftpd-init">
|
|
<title><phrase revision="sysv">Boot Script</phrase>
|
|
<phrase revision="systemd">Systemd Unit</phrase></title>
|
|
|
|
<para>Install the
|
|
<phrase revision="sysv"><filename>/etc/rc.d/init.d/vsftpd</filename> init
|
|
script</phrase>
|
|
<phrase revision="systemd"><filename>vsftpd.service</filename>
|
|
unit</phrase> included in the
|
|
<xref linkend="bootscripts" revision="sysv"/>
|
|
<xref linkend="systemd-units" revision="systemd"/> package.</para>
|
|
|
|
<screen role="root"><userinput>make install-vsftpd</userinput></screen>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
|
|
|
<sect2 role="content">
|
|
<title>Contents</title>
|
|
|
|
<segmentedlist>
|
|
<segtitle>Installed Program</segtitle>
|
|
<segtitle>Installed Libraries</segtitle>
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
<seglistitem>
|
|
<seg>vsftpd</seg>
|
|
<seg>None</seg>
|
|
<seg>/usr/share/vsftpd, /home/ftp</seg>
|
|
</seglistitem>
|
|
</segmentedlist>
|
|
|
|
<variablelist>
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
<?dbfo list-presentation="list"?>
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
<varlistentry id="vsftpd-prog">
|
|
<term><command>vsftpd</command></term>
|
|
<listitem>
|
|
<para>is the FTP daemon.</para>
|
|
<indexterm zone="vsftpd vsftpd-prog">
|
|
<primary sortas="b-vsftpd">vsftpd</primary>
|
|
</indexterm>
|
|
</listitem>
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|