<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sekolah Linux Indonesia &#187; linux ftp server</title>
	<atom:link href="http://www.sekolahlinux.com/tag/linux-ftp-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sekolahlinux.com</link>
	<description>Place for Indonesian Linuxer</description>
	<lastBuildDate>Sat, 13 Aug 2011 04:41:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Linux DHCP</title>
		<link>http://www.sekolahlinux.com/linux-dhcp-2/</link>
		<comments>http://www.sekolahlinux.com/linux-dhcp-2/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 05:46:42 +0000</pubDate>
		<dc:creator>Abu Syams</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux command]]></category>
		<category><![CDATA[Linux DHCP]]></category>
		<category><![CDATA[linux ftp server]]></category>

		<guid isPermaLink="false">http://www.sekolahlinux.com/linux-dhcp-2/</guid>
		<description><![CDATA[Linux DHCP is Dynamic Host Configuration Protocol. It is used to control vital networking parameters of hosts (running clients)with the help of a server. DHCP is backward compatible with BOOTP. For more information see RFC 2131 (old RFC 1541) and other. (See Internet Resources section at the end of the document). This mini-tutorial covers both [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sekolahlinux.com%2Flinux-dhcp-2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sekolahlinux.com%2Flinux-dhcp-2%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div>
<p>Linux DHCP is Dynamic Host Configuration Protocol. It is used to control vital networking parameters of hosts (running clients)with the help of a server. DHCP is backward compatible with BOOTP. For more information see RFC 2131 (old RFC 1541) and other. (See Internet Resources section at the end of the document).</p>
<p>This mini-tutorial covers both the DHCP _SERVER_ daemon as well as DHCP_CLIENT_ daemon. Most people need the client daemon which is used byworkstations to obtain network information from a remote server. The serverdaemon is used by system administrators to distribute network informationto clients so if you are just a regular user you need the _CLIENT_ daemon.</p>
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">Downloading the client daemon (dhcpcd)</span></span></h2>
<p>Depending on your distribution you might have to download the DHCP client daemon. If you want to compile it from the source youpackage you need is called dhcpcd and the current version is 1.3.18. It is maintained by Sergei Viznyuk <tt class="EMAIL">&lt;<a href="mailto:sergei@phystech.com">sergei@phystech.com</a>&gt;</tt> andtoday it comes as a binary package with most distributions.</p>
<p>dhcpcd source can be downloaded from following locations</p>
<ul>
<li><a href="ftp://ftp.phystech.com/pub/" target="_top">ftp://ftp.phystech.com/pub/</a> (Primary site)</li>
<li><a href="http://www.cps.msu.edu/%7Edunham/out/" target="_top">http://www.cps.msu.edu/~dunham/out/</a></li>
</ul>
<p>Then follow the instructions below. They should be the same.</p>
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">Tying it all together</span></span></h2>
<p>After your machine reboots your network interface should be configured.Type: <strong class="COMMAND">ifconfig</strong>.</p>
<p>You should get something like this:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">          lo        Link encap:Local Loopback            inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1          RX packets:302 errors:0 dropped:0 overruns:0 frame:0          TX packets:302 errors:0 dropped:0 overruns:0 carrier:0 coll:0eth0      Link encap:Ethernet  HWaddr 00:20:AF:EE:05:45          inet addr:24.128.53.102  Bcast:24.128.53.255  Mask:255.255.254.0          ^^^^^^^^^^^^^^^^^^^^^^^          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:24783 errors:1 dropped:1 overruns:0 frame:1          TX packets:11598 errors:0 dropped:0 overruns:0 carrier:0 coll:96          Interrupt:10 Base address:0x300</pre>
</td>
</tr>
</tbody>
</table>
<p>If you have some normal number under <tt class="LITERAL">inet addr</tt> you are set. If you see0.0.0.0 don&#8217;t despair, it is a temporary setting before<strong class="COMMAND">dhcpcd</strong> acquiresthe IP address. If even after few minutes you are seeing 0.0.0.0 pleasecheck out  <a href="http://tldp.org/HOWTO/DHCP/x74.html#TROUBLESHOOTING"><em>Troubleshooting</em></a>.  DHCPcd is a daemon and willstay running as long as you have your machine on. Every three hours itwill contact the DHCP server and try to renew the IP address lease. Itwill log all the messages in the syslog (on Slackware<tt class="FILENAME">/var/adm/syslog</tt>, RedHat/OpenLinux<tt class="FILENAME">/var/log/syslog</tt>).</p>
<p>One final thing. You need to specify your nameservers. There are two ways to doit, you can either ask your provider to provide you with the addresses of yourname server and then put those in the<tt class="FILENAME">/etc/resolv.conf</tt> or DHCPcd will obtainthe list from the linux DHCP server and will build a<tt class="FILENAME">resolv.conf</tt> in <tt class="FILENAME">/etc/dhcpc</tt>.</p>
<p>I decided to use linux DHCPcd&#8217;s <tt class="FILENAME">resolv.conf</tt> by doing the following:</p>
<p>Back up your old <tt class="FILENAME">/etc/resolv.conf</tt>: <strong class="COMMAND">mv /etc/resolv.conf/etc/resolv.conf.OLD</strong></p>
<p>If directory <tt class="FILENAME">/etc/dhcpc</tt> doesn&#8217;texist create it: <strong class="COMMAND">mkdir /etc/dhcpc</strong></p>
<p>Make a link from <tt class="FILENAME">/etc/dhcpc/resolv.conf</tt> to<tt class="FILENAME">/etc/resolv.conf</tt>: <strong class="COMMAND">ln -s/etc/dhcpc/resolv.conf /etc/resolv.conf</strong></p>
<p>If that doesn&#8217;t work try this (fix suggested by<tt class="EMAIL">&lt;<a href="mailto:nothing@cc.gatech.edu">nothing@cc.gatech.edu</a>&gt;</tt> with a little amendment by HenrikStoerner):</p>
<p>This last step I had to perform only because my dhcpcd doesn&#8217;tcreate an <tt class="FILENAME">/etc/dhcpc/resolv.conf</tt>.  In <tt class="FILENAME">/etc/sysconfig/network-scripts/ifup</tt> Imade the following changes (which are a very poor hack, but they workfor me):</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then    echo -n "Using DHCP for ${DEVICE}... "    /sbin/dhcpcd -c /etc/sysconfig/network-scripts/ifdhcpc-done ${DEVICE}    echo "echo \$$ &gt; /var/run/dhcp-wait-${DEVICE}.pid; exec sleep 30" | sh    if [ -f /var/run/dhcp-wait-${DEVICE}.pid ]; then^^^^        echo "failed."        exit 1</pre>
</td>
</tr>
</tbody>
</table>
<p>I changed to:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then    echo -n "Using DHCP for ${DEVICE}... "    /sbin/dhcpcd    echo "echo \$$ &gt; /var/run/dhcp-wait-${DEVICE}.pid; exec sleep 30" | sh    if [ ! -f /var/run/dhcp-wait-${DEVICE}.pid ]; then^^^^^^       echo "failed."       exit 1</pre>
</td>
</tr>
</tbody>
</table>
<div class="NOTE">
<blockquote class="NOTE"><p><strong>Note: </strong>Notice the ! (bang) in <tt class="LITERAL">if [ ! -f/var/run/dhcp-wait-${DEVICE}.pid ];</tt></p></blockquote>
</div>
<p>Now sit back and enjoy <img src='http://www.sekolahlinux.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<div class="SECT2">
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">DHCP server for UNIX</span></span></h2>
<p>There are several DHCP servers available for U*X-like OSes,both commercial and free. One of the more popular free DHCP serversis Paul Vixie/ISC DHCPd. Currently the latest version is 2.0 (suggestedfor most users) but 3.0 is in beta testing.  You can get them from</p>
<p><a href="ftp://ftp.isc.org/isc/dhcp/" target="_top">ftp://ftp.isc.org/isc/dhcp/</a></p>
<p>Some of the distributions provide binary packages for dhcpd soskip the following section if you got it installed that way.</p>
<p>After you download unpack it. After you do cd into thedistribution directory and type: <strong class="COMMAND">./configure</strong></p>
<p>It will take some time to configure the settings. After it is done type:<strong class="COMMAND">make</strong> and <strong class="COMMAND">make install</strong>.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">DHCP server configuration</span></span></h2>
<p>When done with installation type <strong class="COMMAND">ifconfig -a</strong>. Youshould see something like this:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">eth0      Link encap:10Mbps Ethernet  HWaddr 00:C0:4F:D3:C4:62          inet addr:183.217.19.43  Bcast:183.217.19.255  Mask:255.255.255.0          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:2875542 errors:0 dropped:0 overruns:0          TX packets:218647 errors:0 dropped:0 overruns:0          Interrupt:11 Base address:0x210</pre>
</td>
</tr>
</tbody>
</table>
<p>If it doesn&#8217;t say MULTICAST you should reconfigure yourkernel and add multicast support. On most systems you will not need to do this.</p>
<p>Next step is to add route for 255.255.255.255. Quoted from DHCPd README:</p>
<blockquote class="BLOCKQUOTE"><p>&#8220;In order for dhcpd to work correctly with picky DHCP clients (e.g., Windows 95), it must be able to send packets with an IP destination address of 255.255.255.255.  Unfortunately, Linux insists on changing 255.255.255.255 into the local subnet broadcast address (here, that&#8217;s 192.5.5.223).  This results in a DHCP protocol violation, and while many DHCP clients don&#8217;t notice the problem, some (e.g., all MicrosoftDHCP clients) do.  Clients that have this problem will appear not to see DHCPOFFER messages from the server.&#8221;</p></blockquote>
<p>Type: <strong class="COMMAND">route add -host 255.255.255.255 dev eth0</strong></p>
<p>If you get a message &#8220;<tt class="LITERAL">255.255.255.255: Unknown host</tt>&#8220;,you should try adding the following entry to your<tt class="FILENAME">/etc/hosts</tt> file:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">255.255.255.255 all-ones</pre>
</td>
</tr>
</tbody>
</table>
<p>Then, try:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">route add -host all-ones dev eth0</pre>
</td>
</tr>
</tbody>
</table>
<p>or</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">route add 255.255.255.0 dev eth0</pre>
</td>
</tr>
</tbody>
</table>
<p><tt class="LITERAL">eth0</tt> is of course the name of the network device youare using.  If it differs change appropriately.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><span style="font-weight: normal;">Options for DHCPd</span></h2>
<p>Now you need to configure DHCPd. In order to do this youwill have to create or edit <tt class="FILENAME">/etc/dhcpd.conf</tt>. Thereis a graphical interface for dhcpd configuration under KDE ( <a href="http://www.kde.org/" target="_top">http://www.kde.org/</a> ) called kcmdhcpdthat is very similar to the DHCP configurator on Windows NT. When KDE2.0 comes out it should come with kcmdhcpd or you could get it directlyfrom <a href="http://www.sekolahlinux.com/linuxftp-server-setup/">linux ftp server</a> at:</p>
<p><a href="ftp://ftp.us.kde.org/pub/kde/unstable/apps/network/" target="_top">ftp://ftp.us.kde.org/pub/kde/unstable/apps/network/</a></p>
<p>If you want to configure it by hand follow instructions below.</p>
<p>Most commonly what you want to do is assign IP addresses randomly. Thiscan be done with settings as follows:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING"># Sample /etc/dhcpd.conf# (add your comments here) default-lease-time 600;max-lease-time 7200;option subnet-mask 255.255.255.0;option broadcast-address 192.168.1.255;option routers 192.168.1.254;option domain-name-servers 192.168.1.1, 192.168.1.2;option domain-name "mydomain.org";subnet 192.168.1.0 netmask 255.255.255.0 {   range 192.168.1.10 192.168.1.100;   range 192.168.1.150 192.168.1.200;}</pre>
</td>
</tr>
</tbody>
</table>
<p>This will result in linux DHCP server giving a client an IP addressfrom the range 192.168.1.10-192.168.1.100 or 192.168.1.150-192.168.1.200. It will lease an IP address for600 seconds if the client doesn&#8217;t ask for specific timeframe. Otherwise the maximum (allowed) lease will be 7200 seconds. Theserver will also &#8220;advise&#8221; the client that it should use 255.255.255.0 asits subnet mask,  192.168.1.255 as its broadcast address, 192.168.1.254 asthe router/gateway and 192.168.1.1 and 192.168.1.2 as its DNS servers.</p>
<p>If you need to specify a WINS server for your Windows clients youwill need to include the <tt class="LITERAL">netbios-name-servers</tt> option e.g.</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">option netbios-name-servers 192.168.1.1;</pre>
</td>
</tr>
</tbody>
</table>
<p>You can also assign specific IP addresses based on clientsethernet address e.g.</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">host haagen {   hardware ethernet 08:00:2b:4c:59:23;   fixed-address 192.168.1.222;}</pre>
</td>
</tr>
</tbody>
</table>
<p>This will assign IP address 192.168.1.222 to a client with ethernetaddress 08:00:2b:4c:59:23.</p>
<p>You can also mix and match e.g. you can have certain clients getting&#8221;static&#8221; IP addresses (e.g. servers) and others being alloteddynamic IPs (e.g. mobile users with laptops). There are a number of otheroptions e.g. nis server addresses, time server addresses etc., if youneed any of those options please read the<tt class="FILENAME">dhcpd.conf</tt> man page.</p>
</div>
<div class="SECT2">
<h2 class="SECT2"><span style="font-weight: normal;"><span style="font-size: medium;">Starting the server</span></span></h2>
<p>There is only one thing to do before starting the server. In most casesDHCP installation doesn&#8217;t create a <tt class="FILENAME">dhcpd.leases</tt>files. This file is used by DHCPd to store information about currentleases. It is in the plain text form so you can view it during theoperation of DHCPd. To create <tt class="FILENAME">dhcpd.leases</tt> type:</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">touch /var/state/dhcp/dhcpd.leases</pre>
</td>
</tr>
</tbody>
</table>
<p>This will create an empty file (file size = 0).Some of the older version of dhcpd 2.0 placed the file in<tt class="FILENAME">/etc/dhcpd.leases</tt>.  You do not need to make anychanges to the leases file it will be manipulated by the dhcpd.  If youget a message saying that file exists simply ignore it and go to thenext step.</p>
<p>You can now invoke the Linux DHCP server. Simply type (or include in the bootupscripts)</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">/usr/sbin/dhcpd</pre>
</td>
</tr>
</tbody>
</table>
<p>This will invoke dhcpd on eth0 device. If you want to invoke iton another device simply supply it on the command line e.g.</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">/usr/sbin/dhcpd eth1</pre>
</td>
</tr>
</tbody>
</table>
<p>To verify that everything is working fine youshould first turn on the debugging mode and put the serverin foreground. You can do this by typing</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">/usr/sbin/dhcpd -d -f</pre>
</td>
</tr>
</tbody>
</table>
<p>Then boot up one of your clients and check out the console of your server. You will see a number of debugging messages come up. If everything works outfine you are done <img src='http://www.sekolahlinux.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Quit dhcpd and start it without the<strong class="COMMAND">-d</strong> <strong class="COMMAND">-f</strong> and arguments. If you wantdhcpd to start at boot-up include dhcpd in e.g.</p>
<table border="0" width="100%" bgcolor="#e0e0e0">
<tbody>
<tr>
<td>
<pre class="PROGRAMLISTING">/etc/rc.d/rc.local</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>Now you can maintain your <a href="http://www.sekolahlinux.com/network-systems/">network systems</a> by using Linux DHCP Server and you must not worry about giving DHCP manually to each client computer.</p>
<p>Other related articles:</p>
<ul>
<li><a href="http://blog.thewulph.com/?p=90">PXE Server for Clonezilla/ESX 4</a> &#8211; Alright, this blog is as much about me as a DJ as it is about what&#8217;s going on in my life, so in following with the open-source I help you if you help me movement, I have a post that&#8217;s a how-to for getting a PXE server running with support for Clonezilla and ESX (vSphere) 4. (For those of you who read this on facebook, it gets auto-uploaded there after I post it on my main site at blog. Also keeping in mind that the steps presented could be modified for just about anything except a Windows boot but there&#8217;s plenty of resources for THAT out there as well (if you&#8217;re interested, look into WinPE it&#8217;s designed for Windows booting over PXE).</li>
<li><a href="http://www.itinfusion.ca/?p=74">LTSP Linux Thin Client School Project Update | | IT Infusion in &#8230;</a> &#8211; I just got back from my son&#8217;s school where we&#8217;ve been rolling out LTSP thin clients into the classrooms. Eventually we&#8217;ll be converting almost all of the computers in both buildings (200+ PCs) into thin clients. There are no other words to describe it.</li>
<li><a href="http://magazine.redhat.com/2008/08/05/linux-dhcp-server-static-ips-are-gone-in-60-seconds/">Red Hat Magazine | Linux DHCP server: Static IPs are gone in 60 &#8230;</a> &#8211; Linux DHCP is a low-cost alternative to proprietary network servers that depend on the user doing a series of GUI clicks. On the surface it may seem convenient to have a “wizard” setup your network for you. But it&#8217;s often better to tap &#8230;</li>
<li><a href="http://www.adamsinfo.com/linux-dhcp-server/">Linux DHCP Server | Adam Palmer, Linux, PHP Programmer, MySQL &#8230;</a> &#8211; Linux DHCP Server.</li>
</ul>
</div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/linux' rel='tag' target='_self'>linux</a>, <a class='technorati-link' href='http://technorati.com/tag/linux+command' rel='tag' target='_self'>linux command</a>, <a class='technorati-link' href='http://technorati.com/tag/Linux+DHCP' rel='tag' target='_self'>Linux DHCP</a>, <a class='technorati-link' href='http://technorati.com/tag/linux+ftp+server' rel='tag' target='_self'>linux ftp server</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sekolahlinux.com/linux-dhcp-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Linux FTP Server Setup</title>
		<link>http://www.sekolahlinux.com/linuxftp-server-setup/</link>
		<comments>http://www.sekolahlinux.com/linuxftp-server-setup/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 10:28:54 +0000</pubDate>
		<dc:creator>Abu Syams</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[active ftp]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[linux ftp server]]></category>
		<category><![CDATA[network systems]]></category>
		<category><![CDATA[passive ftp]]></category>

		<guid isPermaLink="false">http://www.sekolahlinux.com/linuxftp-server-setup/</guid>
		<description><![CDATA[Image via Wikipedia This chapter will show you how to convert your Linux box into an FTP server using the VSFTP package. The RedHat software download site runs on VSFTP. By using Linux FTP Server users can easily share files in your network systems. FTP Overview File Transfer Protocol (FTP) is a common method of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sekolahlinux.com%2Flinuxftp-server-setup%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sekolahlinux.com%2Flinuxftp-server-setup%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Server_Linux.jpg"><img title="Servers designed for Linux" src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Server_Linux.jpg/300px-Server_Linux.jpg" alt="Servers designed for Linux" width="300" height="228" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Server_Linux.jpg">Wikipedia</a></dd>
</dl>
</div>
</div>
<div>
<p>This chapter will show you how to convert your Linux box into an FTP server using the VSFTP package. The RedHat software download site runs on VSFTP. By using Linux FTP Server users can easily share files in your <a href="http://www.sekolahlinux.com/network-systems/">network systems</a>.</p>
<h3>FTP Overview</h3>
<p class="H3Body">File Transfer Protocol (FTP) is a common method of copying files between computer systems. Two TCP ports are used to do this:</p>
<h4>FTP Control Channel &#8211; TCP Port 21</h4>
<p class="H4Body">All commands you send and the ftp server&#8217;s responses to those commands will go over the control connection, but any data sent back (such as&#8221;<strong>ls</strong>&#8221; directory lists or actual file data in either direction)will go over the data connection.</p>
<h4>FTP Data Channel &#8211; TCP Port 20</h4>
<p class="H4Body">Used for all data sent between the client and server.</p>
<h4>Active FTP</h4>
<p class="H4Body">Active FTP works as follows:</p>
<p class="H4Bullets"><span>o<span> </span></span>Your client connects to the FTP server by establishing an FTPcontrol connection to port 21 of the server. Your commands such as <strong>&#8216;ls&#8217;</strong> and <strong>&#8216;get&#8217;</strong> are sent over this connection.</p>
<p class="H4Bullets"><span>o<span> </span></span>Whenever the client requests data over the control connection,the <strong>server</strong> initiates data transfer connections back to the client. The source port of these data transfer connections is always port 20 on the server,and the destination port is a high port on the client.</p>
<p class="H4Bullets"><span>o<span> </span></span>Thus the <strong>&#8216;ls&#8217;</strong> listing that you asked for comes back overthe &#8220;port 20 to high port connection&#8221;, not the port 21 control connection.</p>
<p class="H4Bullets"><span>o<span> </span></span>FTP active mode data transfer therefore does this in a counter intuitive way to the TCP standard as it selects port 20 as it&#8217;s source port(not a random high port &gt; 1024) and connects back to the client on a random high port that has been pre-negotiated on the port 21 control connection.</p>
<p class="H4Bullets"><span>o<span> </span></span>Active FTP may fail in cases where the client is protected from the Internet via many to one NAT (masquerading). This is because the firewall will not know which of the many servers behind it should receive the return connection.</p>
<h4>Passive FTP</h4>
<p class="H4Body">Passive FTP works as follows:</p>
<p class="H4Bullets"><span>o<span> </span></span>Your client connects to the FTP server by establishing a FTP control connection to port 21 of the server. Your commands such as <strong>&#8216;ls&#8217;</strong> and &#8216;get&#8217; are sent over that connection.</p>
<p class="H4Bullets"><span>o<span> </span></span>Whenever the client requests data over the control connection,the <strong>client </strong>initiates the data transfer connections to the server. The source port of these data transfer connections is always a high port on the client with a destination port of a high port on the server.</p>
<p class="H4Bullets"><span>o<span> </span></span>Passive FTP should be viewed as the server never making an active attempt to connect to the client for FTP data transfers.</p>
<p class="H4Bullets"><span>o<span> </span></span>Passive FTP works better for clients protected by a firewall as the client always initiates the required connections.</p>
<h3>Problems With FTP And Firewalls</h3>
<p class="H3Body">FTP frequently fails when the data has to pass through a firewall as FTP uses a wide range of unpredictable TCP ports and firewalls are designed to limit data flows to predictable TCP ports. There are ways to overcome this as explained in the following sections.</p>
<p class="H3Body"><strong>Client Protected By A Firewall Problem</strong></p>
<p class="H4Body">Typically firewalls don&#8217;t let any incoming connections at all,this will frequently cause active FTP not to function. This type of FTP failure has the following symptoms:</p>
<p class="H4Bullets"><span>o<span> </span></span>The <strong>active</strong> ftp connection appears to work when the client initiates an outbound connection to the server on port 21. The connection appears to hang as soon as you do an &#8220;ls&#8221; or a &#8220;dir&#8221; or a&#8221;get&#8221;. This is because the firewall is blocking the return connection from the server to the client. (From port 20 on the server to a high port on the client)</p>
<h5>Solutions</h5>
<p class="H5Body">Here are the general firewall rules you&#8217;ll need to allow FTP clients through a firewall:</p>
<p class="MsoNormal" style="text-align: center;"><span style="text-decoration: underline;">Client Protectedby Firewall &#8211; Required Rules for FTP</span></p>
<p class="MsoNormal">
<p class="H4Body">
<div>
<table class="MsoNormalTable" style="width: 499.5pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" width="666">
<thead>
<tr>
<td style="border: 1pt inset #111111; padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Method</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Source Address</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Source</span></strong><strong><span style="color: white;"> </span></strong><strong><span style="color: white;">Port</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Destination</span></strong></p>
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Address</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Destination</span></strong></p>
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Port</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Connection</span></strong></p>
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Type</span></strong></p>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 7.5pt; width: 467.25pt;" colspan="6" width="623" valign="top">
<p class="MsoNormal" style="text-align: center;">Allow outgoing  control connections to server</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">Control</p>
<p class="MsoNormal" style="text-align: center;">Channel</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/ network</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">21</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">New</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">21</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/ network</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">Established*</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 467.25pt;" colspan="6" width="623" valign="top">
<p class="MsoNormal" style="text-align: center;">Allow the client to  establish data channels to remote server</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">Active FTP</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">20</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client /network</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">New</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/ network</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">20</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">Established*</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">Passive</p>
<p class="MsoNormal" style="text-align: center;">FTP</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/ network</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">New</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/ network</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">Established*</p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal">
<p class="H3Body">*Many home based firewall/routers automatically allow traffic for already established connections. This rule may not be necessary in all cases.</p>
<p class="H3Body">** in some cases, you may want to allow all Internet users to have access, not just a specific client server or network.</p>
<h4>Server Protected By A Firewall Problem</h4>
<p class="H4Bullets"><span>o<span> </span></span>Typically firewalls don&#8217;t let any connections come in at all. FTP server failure due to firewalls in which the <strong>active</strong> ftp connection from the client doesn&#8217;t appear to work at all</p>
<h5>Solutions</h5>
<p class="H5Body">Here are the general firewall rules you&#8217;ll need to allow FTP severs through a firewall</p>
<p class="MsoNormal" style="text-align: center;"><span style="text-decoration: underline;">Server Protectedby Firewall &#8211; Required Rules for FTP</span></p>
<p class="MsoNormal">
<p class="H4Body">
<div>
<table class="MsoNormalTable" style="width: 499.5pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0" width="666">
<thead>
<tr>
<td style="border: 1pt inset #111111; padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Method</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Source Address</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Source</span></strong><strong><span style="color: white;"> </span></strong><strong><span style="color: white;">Port</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Destination</span></strong></p>
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Address</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Destination</span></strong></p>
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Port</span></strong></p>
</td>
<td style="padding: 7.5pt; background: none repeat scroll 0% 0% green; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Connection</span></strong></p>
<p class="MsoNormal" style="text-align: center;"><strong><span style="color: white;">Type</span></strong></p>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 7.5pt; width: 467.25pt;" colspan="6" width="623" valign="top">
<p class="MsoNormal" style="text-align: center;">Allow incoming  control connections to server</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">Control</p>
<p class="MsoNormal" style="text-align: center;">Channel</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/  network**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">21</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">New</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">21</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/  network**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">Established*</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 467.25pt;" colspan="6" width="623" valign="top">
<p class="MsoNormal" style="text-align: center;">Allow server to  establish data channel to remote client</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">Active FTP</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">20</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP  client/network**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">New</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/  network**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">20</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">Established*</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">Passive</p>
<p class="MsoNormal" style="text-align: center;">FTP</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/  network**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">New</p>
</td>
</tr>
<tr>
<td style="padding: 7.5pt; width: 59.25pt;" width="79" valign="top">
<p class="MsoNormal" style="text-align: center;">
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP server</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">FTP client/  network**</p>
</td>
<td style="padding: 7.5pt; width: 81.75pt;" width="109" valign="top">
<p class="MsoNormal" style="text-align: center;">High</p>
</td>
<td style="padding: 7.5pt; width: 81pt;" width="108" valign="top">
<p class="MsoNormal" style="text-align: center;">Established*</p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal">
<p class="H3Body">*Many home based firewall/routers automatically allow trafficfor already established connections. This rule may not be necessary in all cases.</p>
<p class="H3Body">** in some cases, you may want to allow all Internet users to have access, not just a specific client server or network.</p>
<h3>How ToDownload And Install The VSFTP Package</h3>
<p class="H3Bullets"><span style="font-family: Symbol;">·<span> </span></span> As explained previously, RedHatsoftware is installed using RPM packages. In version 8.0 of the operatingsystem, the VSFTP RPM file is named:</p>
<p class="H35Linux">
<p class="H35Linux">vsftpd-1.1.0-1.i386.rpm</p>
<p class="H35Linux">
<p class="H35Body">Downloading and installing RPMs isn’t hard. If you need are fresher, the RPM chapter covers how to do this in detail.</p>
<p class="H3Bullets"><span style="font-family: Symbol;">·<span> </span></span>Now download the file to a directory such as <strong>/tmp</strong> and install it using the “rpm” command:</p>
<p class="H3Body">
<p class="H3Linux">[root@bigboy tmp]# rpm -Uvh vsftpd-1.1.0-1.i386.rpm<br />
Preparing&#8230; ########################################### [100%]<br />
1:vsftpd     ###########################################[100%]</p>
<p class="H3Linux">[root@bigboy tmp]#</p>
<h3>How To Get VSFTP Started</h3>
<p class="H3Body">The starting and stopping of VSFTP is controlled by xinetd via the <strong>/etc/xinetd.d/vsftpd</strong> file. VSFTP is deactivated by default, so you’ll have to edit this file to start the program. Make sure the contents look like this. The disable feature must be set to &#8220;no&#8221; to accept connections.</p>
<p class="H3Linux">service ftp<br />
{</p>
<p class="H4Linux">disable = no<br />
socket_type = stream<br />
wait = no<br />
user = root<br />
server = /usr/sbin/vsftpd<br />
nice = 10</p>
<p class="H3Linux">}</p>
<p class="H3Body">
<p class="H3Body">You will then have to restart xinetd for these changes to take effect using the startup script in the <strong>/etc/init.d</strong> directory.</p>
<p class="H3Linux">[root@aqua tmp]#  /etc/init.d/xinetd restart</p>
<p class="H3Linux">Stopping xinetd: [  OK  ]</p>
<p class="H3Linux">Starting xinetd: [  OK  ]</p>
<p class="H3Linux">[root@aqua tmp]#</p>
<p class="H3Body">Naturally, to disable VSFTP once again, you’ll have to edit <strong>/etc/xinetd.d/vsftpd</strong>,set “disable” to “yes” and restart xinetd.</p>
<h3>Testing To See If VSFTP Is Running</h3>
<p class="H3Body">You can always test whether the VSFTP process is running byusing the <strong>netstat –a</strong> command which lists all the TCP and UDP ports on which the server is listening for traffic. The example below shows the expected output, there would be no output at all if VSFTP wasn’t running.</p>
<p class="H3Linux">[root@bigboy root]# netstat -a | grep ftp<br />
tcp       0       0       *:ftp        *:*        LISTEN<br />
[root@bigboy root]#</p>
<h3>What Is Anonymous FTP?</h3>
<p class="H3Body">Anonymous FTP is used by web sites that need to exchange fileswith numerous unknown remote users. Common uses include downloading software updates and MP3s to uploading diagnostic information for a technical support engineer’s attention. Unlike regular FTP where you login with a user-specific username, anonymous FTP only requires a username of &#8220;anonymous&#8221; and your email address for the password. Once logged in to a VSFTP server, you’ll automatically have access to only the default anonymous FTP directory <strong>/var/ftp</strong>and all its subdirectories.</p>
<p class="H3Body">As seen in the chapter on RPMs, using anonymous FTP as a remote user is fairly straight forward. VSFTP can be configured to support user based and or anonymous FTP in its configuration  file.</p>
<h3>The /etc/vsftpd.conf File</h3>
<p class="H3Body">VSFTP only reads the contents of its <strong>/etc/vsftpd.conf </strong>configurationfile when it starts, so you’ll have to restart xinetd each time you edit the file in order for the changes to take effect.</p>
<p class="H3Body">This file uses a number of default settings you need to know.By default, VSFTP runs as an anonymous FTP server. Unless you want any remote user to log into to your default FTP directory using a username of “anonymous”and a password that’s the same as their email address, I would suggest turning this off. The configuration file’s <strong>anonymous_enable</strong> instruction can becommented out by using a “#” to disable this feature. You’ll also want to simultaneously enable local users to be able to log in by uncommenting the <strong>local_enable </strong>instruction.</p>
<p class="H3Body">By default VSFTP only allows anonymous FTP downloads to remote users, not uploads from them. Also by default, VSFTP doesn&#8217;t allow remote usersto create directories on your FTP server and it logs FTP access to the <strong>/var/log/vsftpd.log</strong>log file.</p>
<p class="H3Body">The configuration file is fairly straight forward as you cansee in the snippet below. Remove/add the &#8220;#&#8221; at the beginning of theline to &#8220;activate/deactivate&#8221; the feature on each line.</p>
<p class="MsoNormal">
<p class="H3Linux"># Allow anonymous FTP?<br />
<span style="color: red;">anonymous_enable=YES<br />
</span>&#8230;</p>
<p class="H3Linux">&#8230;</p>
<p class="H3Linux"># Uncomment this to allow local users to log in.<br />
<span style="color: red;">local_enable=YES</span><br />
&#8230;</p>
<p class="H3Linux">&#8230;</p>
<p class="H3Linux"># Uncomment this to enable any form of FTP write command.</p>
<p class="H3Linux"># (Needed even if you want local users to be able to uploadfiles)<br />
write_enable=YES<br />
&#8230;</p>
<p class="H3Linux">&#8230;</p>
<p class="H3Linux"># Uncomment to allow the anonymous FTP user to upload files. Thisonly<br />
# has an effect if global write enable is activated. Also, you will<br />
# obviously need to create a directory writable by the FTP user.<br />
#anon_upload_enable=YES<br />
&#8230;</p>
<p class="H3Linux">&#8230;</p>
<p class="H3Linux"># Uncomment this if you want the anonymous FTP user to be ableto create<br />
# new directories.<br />
#anon_mkdir_write_enable=YES<br />
&#8230;</p>
<p class="H3Linux">&#8230;</p>
<p class="H3Linux"># Activate logging of uploads/downloads.<br />
xferlog_enable=YES<br />
&#8230;</p>
<p class="H3Linux">&#8230;</p>
<p class="H3Linux"># You may override where the log file goes if you like.</p>
<p class="H3Linux"># The default is shown# below.<br />
#xferlog_file=/var/log/vsftpd.log</p>
<p class="MsoNormal">
<h3>FTP Security Issues</h3>
<h4>The /etc/vsftpd.ftpusersFile</h4>
<p class="H4Body">For added security you may restrict FTP access to certain usersby adding them to the list of users in this file. Do not delete entries from the default list, it is best to add.</p>
<h4>Anonymous Upload</h4>
<p class="H4Body">If you want remote users to write data to your FTP server then it is recommended you create a write-only directory within <strong>/var/ftp/pub</strong>.This will allow your users to upload, but not access other files uploaded by other users. Here are the commands to do this:</p>
<p class="H4Linux">[root@bigboy tmp]# mkdir /var/ftp/pub/upload<br />
[root@bigboy tmp]# chmod 733 /var/ftp/pub/upload</p>
<h4>FTP Greeting Banner</h4>
<p class="H4Body">Change the default greeting banner in <strong>/etc/vsftpd.conf</strong>to make it harder for malicious users to determine the type of system you have.</p>
<p class="H4Linux">ftpd_banner= New Banner Here</p>
<h4>Using SCP As SecureAlternative To FTP</h4>
<p class="H4Body">One of the disadvantages of FTP is that it does not encryptyour username and password. This could make your user account vulnerable to an unauthorized attack from a person eavesdropping on the network connection.Secure Copy (SCP) provides encryption and could be considered as an alternative to FTP for trusted users. SCP however does not support anonymous services, a feature that FTP does.</p>
<p class="H4Body"><span style="font-size: 10pt; font-family: Arial;">Other related articles:</span></p>
<ul>
<li><a href="http://blogs.snapstream.com/2005/08/15/featured-living-room-five/">Featured Living Room FIVE</a> &#8211; It&#8217;s time to showcase another SnapStream Digital Living Room. This one was submitted to us by Jason C., Cisbmet1 on Flickr. He has a big screen TV with his entertainment components stacked neatly beside it in a glass case. &#8230;</li>
<li><a href="http://jcortesweb.com/2009/09/ubuntu-linux-ftp-server-setup-guide-proftpd/">Ubuntu Linux FTP Server Setup Guide (ProFTPD) | JCortes Web</a> &#8211; If you are a web designer, such as myself, you know the importance of having access to a web server through FTP. I just recently set up an FTP server on my.</li>
<li><a href="http://student.exattosoft.com/linux-dedicated-server.eswp">Linux Dedicated Server</a> &#8211; Linux Dedicated Server For Uploading Sites Online Linux Mail Server, Linux Ftp Server, Linux Dns Server, Redhat Linux Ftp Server – Dns Server Configuration In Linux, Linux Dns Server Configuration- Li. read more &#8230;</li>
<li><a href="http://www.unixweblog.com/2010/05/setup-and-secure-a-linux-ftp-server-1/">Setup and Secure a Linux FTP Server – 1</a> &#8211; LinuxIntro. com Linux Videos, Software, Linux Forums, Linux Installation, Linux Tutorials, Linux Lessons, howto, Wireless, Examples, Fedora, Ubuntu.</li>
<li><a href="http://www.online10.info/need-help-with-logging-into-my-linux-ftp-server/">Need help with logging into my Linux ftp server?</a> &#8211; [12:35:34] SmartFTP v2.0.1002.2 [12:35:34] Resolving host name “**.***.***.***” [12:35:34] Connecting to **.***.***.*** Port: 22 [12:35:34] Connected to **.***.***.***. [12:35:34] SSH-1.99-OpenSSH_4.2 &#8230;</li>
<li><a href="http://www.howtomonster.com/2007/08/06/how-to-setup-a-linux-ftp-server/">How to setup a Linux ftp server with proftpd</a> &#8211; How to setup a Linux ftp server with proftpd, installation and configuration.</li>
<li><a href="http://www.howtomonster.com/2007/08/07/your-top-ten-linux-commands/">Your top ten linux commands</a> &#8211; Your top ten linux commands, top 10 commands in your command history.</li>
</ul>
</div>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=0a4d4a0d-4936-4754-9c48-204e9abf1a95" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/active+ftp' rel='tag' target='_self'>active ftp</a>, <a class='technorati-link' href='http://technorati.com/tag/firewall' rel='tag' target='_self'>firewall</a>, <a class='technorati-link' href='http://technorati.com/tag/linux+ftp+server' rel='tag' target='_self'>linux ftp server</a>, <a class='technorati-link' href='http://technorati.com/tag/network+systems' rel='tag' target='_self'>network systems</a>, <a class='technorati-link' href='http://technorati.com/tag/passive+ftp' rel='tag' target='_self'>passive ftp</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sekolahlinux.com/linuxftp-server-setup/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

