📄 vsftpd installation from source - vsftpdrocks_org.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0034)http://www.vsftpdrocks.org/source/ -->
<HTML><HEAD><TITLE>vsftpd installation from source - vsftpdrocks.org</TITLE><!-- InstanceBegin template="/Templates/index.dwt.php" codeOutsideHTMLIsLocked="false" --><!-- InstanceBeginEditable name="doctitle" --><!-- InstanceEndEditable -->
<META content="vsftpd,vsftp,vsftpd installation,how to install vsftpd"
name=keywords>
<META
content="Vsftpd installation made easy. Vsftpdrocks.org contains installation and configuration instruction for the vsftpd ftp server software."
name=description>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<META content="MSHTML 6.00.2800.1528" name=GENERATOR></HEAD>
<BODY>
<TABLE cellSpacing=0 cellPadding=0 width=800 border=0>
<TBODY>
<TR>
<TD>
<DIV align=center>
<P><IMG height=70
src="vsftpd installation from source - vsftpdrocks_org.files/vsftpd_logo.gif"
width=450><BR><FONT face="Arial, Helvetica, sans-serif" size=2><A
href="http://www.vsftpdrocks.org/">home</A> | <A
href="http://www.vsftpdrocks.org/about">about</A> | <A
href="http://www.vsftpdrocks.org/faq">faq</A> | <A
href="http://www.vsftpdrocks.org/links">links</A> | <A
href="http://www.vsftpdrocks.org/contact">contact</A></FONT></P></DIV></TD></TR>
<TR><!-- InstanceBeginEditable name="top" -->
<TD>
<DIV align=center><FONT face="Arial, Helvetica, sans-serif"
size=2><STRONG>installation of vsftpd from source</STRONG></FONT></DIV></TD><!-- InstanceEndEditable --></TR>
<TR><!-- InstanceBeginEditable name="main" -->
<TD vAlign=top>
<P> </P>
<P><FONT face="Arial, Helvetica, sans-serif" color=#ff0000
size=2><STRONG>Step 1: downloading vsftpd</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>You can download the
latest version of vsftpd here: <A
href="ftp://vsftpd.beasts.org/users/cevans/vsftpd-1.2.1.tar.gz">ftp://vsftpd.beasts.org/users/cevans/vsftpd-1.2.1.tar.gz</A></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>From the command line,
the easiest way to download vsftpd is:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>wget
ftp://vsftpd.beasts.org/users/cevans/vsftpd-1.2.1.tar.gz</STRONG></FONT></P>
<P> </P>
<P><FONT face="Arial, Helvetica, sans-serif" color=#ff0000
size=2><STRONG>Step 2: Unpack the vsftpd tarball</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>tar zxvf
vsftpd-1.2.1.tar.gz</STRONG></FONT></P>
<P><STRONG><FONT face="Arial, Helvetica, sans-serif" size=2>cd
vsftpd-1.2.1</FONT></STRONG></P>
<P> </P>
<P><FONT face="Arial, Helvetica, sans-serif" color=#ff0000
size=2><STRONG>Step 3: Installing vsftpd</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif"
size=2><STRONG>make</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>If the user "nobody"
does not already exist, create it:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>useradd
nobody</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Vsftpd requires the
directory /usr/share/empty. If it doesn't exist already, create
it:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>mkdir
/usr/share/empty</STRONG></FONT></P>
<TABLE cellSpacing=0 cellPadding=0 width=600 border=1>
<TBODY>
<TR>
<TD vAlign=top>
<P><FONT face="Arial, Helvetica, sans-serif" color=#0000cc
size=2><STRONG>If you plan to have an anonymous FTP
server:</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>mkdir
/var/ftp</STRONG></FONT></P>
<P><STRONG><FONT face="Arial, Helvetica, sans-serif" size=2>useradd
-d /var/ftp ftp</FONT></STRONG></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>If a user "ftp"
already exists, you may want to do the following:</FONT></P>
<P><STRONG><FONT face="Arial, Helvetica, sans-serif" size=2>chown
root.root /var/ftp</FONT></STRONG></P>
<P><STRONG><FONT face="Arial, Helvetica, sans-serif" size=2>chmod
og-w /var/ftp</FONT></STRONG></P></TD></TR></TBODY></TABLE>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Now install
vsftpd</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>make
install</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>The "make install"
command should copy the needed files to the right places, but sometimes it
doesn't. Therefore, you may want to manually copy the following items to
their correct location:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>cp vsftpd
/usr/local/sbin/vsftpd<BR>cp vsftpd.conf.5 /usr/local/man/man5<BR>cp
vsftpd.8 /usr/local/man/man8</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>And now we copy the
main config file to it's rightful location:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>cp vsftpd.conf
/etc</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Now let's test the
installation. The following test will setup vsftpd to run in "standalone"
mode (without inetd or xinetd).</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>First, let's tell
vsftpd to run in "standalone" mode.</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>vi
/etc/vsftpd.conf</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Add the following
line, or if the line is already present make sure it reads as
follows:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif"
size=2><STRONG>listen=YES</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Save and exit from the
vsftpd.conf config file.</FONT></P>
<P> </P>
<P><FONT face="Arial, Helvetica, sans-serif" color=#ff0000
size=2><STRONG>Step 4: Startup and test in "standalone"
mode</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Now let's start up
vsftpd...</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif"
size=2><STRONG>/usr/local/sbin/vsftpd &</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Now try to ftp to your
server. A successful ftp session should look like this:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" color=#ff6600
size=2><STRONG>[root@somehost]ftp localhost<BR>Connected to
localhost.localdomain.<BR>220 (vsFTPd 1.2.1)<BR>Name (localhost:admin):
<FONT color=#0000cc>bobsmith</FONT> </STRONG><FONT
color=#000000>(obviously, you will want to use a valid user on your server
for the login name)</FONT><STRONG><BR>331 Please specify the
password.<BR>Password:<BR>230 Login successful.<BR>Remote system type is
UNIX.<BR>Using binary mode to transfer files.<BR>ftp> ls<BR>150 Here
comes the directory listing.<BR>-rw-r--r-- 1 1001 1001 25372 Jan 17 18:50
somefile.tar.gz<BR>drwx------ 2 1001 1001 512 Jan 16 19:16
index.htm<BR>226 Directory send OK.<BR>ftp> quit<BR>221
Goodbye.<BR>[root@somehost] </STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>If you got a response
similar to the one above, you're all set! If you would rather run your ftp
server out of either inetd or xinetd, then you will want to continue with
the next test. <FONT color=#0000cc><STRONG>I recommend running vsftpd out
of either inetd or xinetd.</STRONG></FONT></FONT></P>
<P> </P>
<P><STRONG><FONT face="Arial, Helvetica, sans-serif" color=#ff0000
size=2>Step 5: Configuration for inetd/xinetd
operation:</FONT></STRONG></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>To configure vsftpd
for inetd or xinetd operation, do the following:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>First, let's edit the
/etc/vsftpd.conf file and tell it not to run in "standalone"
mode:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>vi
/etc/vsftpd.conf</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Make sure the
following line exists and is set to "NO":</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif"
size=2><STRONG>listen=NO</STRONG></FONT></P>
<TABLE cellSpacing=0 cellPadding=0 width=600 border=1>
<TBODY>
<TR>
<TD>
<P><FONT face="Arial, Helvetica, sans-serif" color=#0000cc
size=2><STRONG>If you are running inetd, do the
following:</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>vi
/etc/inetd.conf</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>If there are any
existing and active ftp service lines, comment them out or delete
them and then add the following line:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" color=#009900
size=2><STRONG>ftp stream tcp nowait root /usr/local/sbin/vsftpd
vsftpd</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Save and
exit.</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Now restart
inetd:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Redhat
users:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif"
size=2><STRONG>/etc/rc.d/init.d/inetd restart</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>FreeBSD
users:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>killall
inetd</STRONG></FONT></P>
<P><STRONG><FONT face="Arial, Helvetica, sans-serif"
size=2>/usr/sbin/inetd -wW</FONT></STRONG></P></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=600 border=1>
<TBODY>
<TR>
<TD vAlign=top>
<P><FONT face="Arial, Helvetica, sans-serif" color=#0000cc
size=2><STRONG>If you are running xinetd, do the
following:</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2>Redhat
users:</FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" size=2><STRONG>vi
/etc/xinetd.d/vsftpd</STRONG></FONT></P>
<P><FONT face="Arial, Helvetica, sans-serif" color=#ff6600
size=2><STRONG># default: off<BR># description: The vsftpd FTP
server serves FTP connections. It uses \<BR># normal, unencrypted
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -