<?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>Blog on Charlie's Server &#187; FTP</title> <atom:link href="http://blog.charlies-server.com/tag/ftp/feed" rel="self" type="application/rss+xml" /><link>http://blog.charlies-server.com</link> <description></description> <lastBuildDate>Fri, 09 Sep 2011 05:31:51 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Allowing Access to FTP Disk Only Via FTP</title><link>http://blog.charlies-server.com/2008/08/10/allowing-access-to-ftp-disk-only-via-ftp</link> <comments>http://blog.charlies-server.com/2008/08/10/allowing-access-to-ftp-disk-only-via-ftp#comments</comments> <pubDate>Sun, 10 Aug 2008 22:25:26 +0000</pubDate> <dc:creator>Hasan</dc:creator> <category><![CDATA[Geekdom]]></category> <category><![CDATA[FTP]]></category> <category><![CDATA[HOWTO]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Security]]></category><guid isPermaLink="false">http://blog.charlies-server.com/?p=122</guid> <description><![CDATA[For bandwidth shaping reasons, I wanted to be able to allow access to my FTP disk (mounted at /var/ftp) only via FTP (hosted by ProFTPd). As it turns out, this is quite easy to do using a couple of UNIX permissions tricks and some ProFTPd voodoo. Read on for the basic description of how I&#8217;ve [...]]]></description> <content:encoded><![CDATA[<p>For bandwidth shaping reasons, I wanted to be able to allow access to my FTP disk (mounted at <code>/var/ftp</code>) only via FTP (hosted by <a href="http://www.proftpd.org/" title="My FTP Daemon of Choice.">ProFTPd</a>). As it turns out, this is quite easy to do using a couple of UNIX permissions tricks and some ProFTPd voodoo. Read on for the basic description of how I&#8217;ve done it.<span id="more-122"></span></p><p><strong>Note</strong>: Here we will assume that ProFTPd has been configured for SQL authentication.</p><h3 id="toc-restricting-access-via-shell">Restricting Access Via Shell</h3><p>The first thing that needs to be done is to restrict permissions on the FTP disk so that shell users aren&#8217;t allowed to read it. This requires some simple UNIX permissions knowledge, and I used the following to get the job done.</p><p><code class="block">chown -r gongloo:ftp /var/ftp<br /> find /var/ftp -type f -exec chmod 640 {} \;<br /> find /var/ftp -type d -exec chmod 755 {} \;</code></p><p>That&#8217;ll set the permissions for all directories so that they can be opened by anyone but written to only by <code>gongloo</code>, and permissions for all files so that they can only be read by those in the <code>ftp</code> group and, again, can only be written to by <code>gongloo</code>. This means that any users who have FTP access as well as shell access will be able to list, but unable to read, the files on the FTP disk via shell.</p><p>Now all that we have to do is make sure that the <code>ftp</code> UNIX group contains only members that should have access to the FTP disk via shell.</p><h3 id="toc-allowing-access-via-ftp">Allowing Access Via FTP</h3><p>The second thing we need to get done is to allow access to the files via FTP for those users who should have it. This is fairly straightforward if we configure ProFTPd to assign GIDs directly from the SQL database that it uses as its authentication backend. We simply create an entry in the SQL table for ProFTPd groups matching the <code>ftp</code> entry in <code>/etc/group</code>. I used something like the following:</p><p><code class="block">INSERT INTO groups (groupname, gid, members) VALUES<br /> ('ftp', '21', 'userid1, userid2, userid3, ..., useridn');</code></p><p>And that&#8217;s it! Users listed in the <code>ftp</code> group in the SQL database are now able to grab files off of the FTP disk. Huzzah!</p> ]]></content:encoded> <wfw:commentRss>http://blog.charlies-server.com/2008/08/10/allowing-access-to-ftp-disk-only-via-ftp/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>FTP Server Back!</title><link>http://blog.charlies-server.com/2008/08/08/ftp-server-back</link> <comments>http://blog.charlies-server.com/2008/08/08/ftp-server-back#comments</comments> <pubDate>Fri, 08 Aug 2008 21:48:25 +0000</pubDate> <dc:creator>Hasan</dc:creator> <category><![CDATA[Geekdom]]></category> <category><![CDATA[FTP]]></category><guid isPermaLink="false">http://blog.charlies-server.com/?p=121</guid> <description><![CDATA[Since I&#8217;m now back on Comcast as my backbone to the great intertubes, I&#8217;m able to re-enable the FTP server. I&#8217;m proud to announce that the FTP server is back and is available for immediate consumption. This should provide an added benefit over SFTP/SCP in that resuming transfers is easier; especially helpful since I get [...]]]></description> <content:encoded><![CDATA[<p>Since I&#8217;m now back on Comcast as my backbone to the great <a href="http://xkcd.com/181/" title="xkcd - Interblag">intertubes</a>, I&#8217;m able to re-enable the FTP server. I&#8217;m proud to announce that the FTP server is back and is available for immediate consumption. This should provide an added benefit over SFTP/SCP in that resuming transfers is easier; especially helpful since I get a great deal of dropped connections (Comcast, are you listening?) on long-lived and/or heavy-traffic sockets.<span id="more-121"></span></p><p>In the near future I will set up permissions so that the FTP file system will be unavailable via SFTP &#8212; that way, there&#8217;s a privilege separation that&#8217;s easier to manage than the hodge-podge that currently exists. At that point, I&#8217;ll write another update to show how I did it!</p> ]]></content:encoded> <wfw:commentRss>http://blog.charlies-server.com/2008/08/08/ftp-server-back/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>&#8230;And From the Ashes, An FTP is Reborn</title><link>http://blog.charlies-server.com/2006/09/29/and-from-the-ashes-an-ftp-is-reborn</link> <comments>http://blog.charlies-server.com/2006/09/29/and-from-the-ashes-an-ftp-is-reborn#comments</comments> <pubDate>Fri, 29 Sep 2006 18:06:28 +0000</pubDate> <dc:creator>Hasan</dc:creator> <category><![CDATA[Geekdom]]></category> <category><![CDATA[FTP]]></category> <category><![CDATA[Linux]]></category><guid isPermaLink="false">http://newblog.charlies-server.com/2006/09/29/and-from-the-ashes-an-ftp-is-reborn/</guid> <description><![CDATA[The good news: Charlie&#8217;s Server&#8217;s FTP service is back online, with all of the old data to boot! The bad news: One of the drives in the FTP array died. The ugly news: LVM didn&#8217;t want to activate the array in partial mode. Read on for technical details and how I revived a dead LVM [...]]]></description> <content:encoded><![CDATA[<p>The good news: Charlie&#8217;s Server&#8217;s FTP service is back online, with all of the old data to boot!</p><p>The bad news: One of the drives in the FTP array died.</p><p>The ugly news: LVM didn&#8217;t want to activate the array in partial mode.</p><p>Read on for technical details and how I revived a dead LVM array with a missing drive.<br /> <span id="more-80"></span><br /> About a week ago, I realized that one of the disks in my LVM array was dying, with I/O errors on certain sectors of the drive. Not wanting to take <em>too</em> much of a risk (of course, no backups and no mirroring, &#8217;cause the cool kids live on the edge like that), I decided to initiate a <code>pvmove</code> immediately. Trying to be smart about it, I decided to do the <code>pvmove</code> in chunks rather than have it process the entire drive at once. Of the 3500 or so physical extents of 32MB each, I did my moves in the following fashion and order.</p><table class="visible"><tr><th>Physical Extents</th><th>Result</th></tr><tr><td>1-1000</td><td>Success</td></tr><tr><td>1001-2000</td><td>Success</td></tr><tr><td>The Rest</td><td><strong><em>FAILURE</em></strong></td></tr><tr></tr></table><p>Amazingly enough, the drive died completely during the metadata update phase of the move. This means that all of the data was actually mirrored by that point (or at least as much of it as could be read from the device without error). What threw me off was that LVM simply refused to activate the volume group and logical volume(s), even in <code>--partial</code> mode.</p><p>After failing to bring back the volumes using partial mode, I started to try a bunch of random, even crazy, solutions. Word on the grapevine is that you can sometimes revive a dead drive by freezing it &#8212; literally, in the freezer. So I left the culprit in the freezer for an ninety minutes, and then gave it a shot. Still no dice, though this technique <a href="http://geeksaresexy.blogspot.com/2006/01/freeze-your-hard-drive-to-recover-data.html" title="HDD Revival via Freezer: A Success Story">has apparently worked for others</a>.</p><p>Just before deciding to completely scrap the entire volume group, I thought of something only half-crazy. Why not complete <code>pvmove</code>&#8216;s job by hand? It should be fairly straightforward to manually modify the volume group configuration and overwrite the currently loaded configuration with my modified version. I was able to do just that, with some calculations as to which physical extents belong in which sections of which logical volumes.</p><p>Somehow, I ended up getting things right on the first try (if I had a dime every time that happened, I&#8217;d still be dirt poor), and am pleased to announce that I don&#8217;t see any data integrity loss! After checking a routine check of all of the remaining devices for bad blocks (lest this happen again right away) and then a routine <code>e2fsck -y</code> to fix any errors on the filesystem, all was well! Thankfully the aforementioned dead sectors (on which those I/O errors occurred) stored blank nodes on the filesystem anyways, so things just worked themselves out.</p><p>That having been said, I&#8217;m definitely keeping an anxious eye on <a title="A Crazy New Filesystem for OpenSolaris" href="http://www.opensolaris.org/os/community/zfs/">ZFS</a> and specifically its <a href="http://www.wizy.org/wiki/ZFS_on_FUSE" title="ZFS on FUSE Port Project">port to Linux</a>. Looks like it might solve some of my problems!</p> ]]></content:encoded> <wfw:commentRss>http://blog.charlies-server.com/2006/09/29/and-from-the-ashes-an-ftp-is-reborn/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)

Served from: blog.charlies-server.com @ 2012-02-10 22:03:40 -->
