<?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>Made of Bugs &#187; afuse</title>
	<atom:link href="http://blog.nelhage.com/tag/afuse/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nelhage.com</link>
	<description>It's software. It's made of bugs.</description>
	<lastBuildDate>Thu, 18 Aug 2011 21:57:23 +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>Automounting sshfs</title>
		<link>http://blog.nelhage.com/2008/03/automounting-sshfs/</link>
		<comments>http://blog.nelhage.com/2008/03/automounting-sshfs/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 22:54:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[afuse]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshfs]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=9</guid>
		<description><![CDATA[For some time now, many of us around MIT have noticed just how awesome sshfs is. It gives a totally lightweight way to access the remote filesystem of any machine you have ssh to, without requiring any extra setup on the host. I&#8217;ve been running for at least a year now with my /data RAID [...]]]></description>
			<content:encoded><![CDATA[<p>For some time now, many of us around MIT have noticed just how awesome
<a href="http://fuse.sourceforge.net/sshfs.html">sshfs</a> is. It gives a totally lightweight way to access the
remote filesystem of any machine you have ssh to, without requiring
<em>any</em> extra setup on the host. I&#8217;ve been running for at least a year
now with my <code>/data</code> RAID on my server sshfs-mounted on my laptop, and
it works totally great.</p>

<p>Recently, I came across two awesome things that make sshfs even
neater. The first is the <code>ServerAliveInterval</code> ssh configuration
option. I (and many others) had noticed that if you changed IP
addresses (which happens all the time with our laptops), sshfs will
just kinda hang there, and so will anything that tries to access
anything in the ssfs-mounted filesystem. <code>sshfs</code> has a <code>-o reconnect</code>
option that makes it automatically reconnect the underlying ssh if it
dies, but it doesn&#8217;t solve the problem of the ssh hanging forever. The
solution, it turns out, is the <code>ServerAliveInterval</code> config
option. Just add</p>

<pre><code>Host *
ServerAliveInterval 15
</code></pre>

<p>to <code>.ssh/config</code>, and ssh will send in-protocol keepalives every 15
seconds if the connection is idle, and die if it doesn&#8217;t receive
anything back. Combine this with <code>-o reconnect</code>, and everything Just
Works when you change IPs</p>

<p>The second cool thing is <a href="http://afuse.sourceforge.net/">afuse</a>, the FUSE automounter. It lets
you set up an automounter for just about anything you can think of,
using another FUSE filesystem itself. I simply run it as</p>

<pre><code>afuse -o mount_template='sshfs -o reconnect %r:/ %m' -o unmount_template='fusermount -u -z %m' /ssh
</code></pre>

<p>from my <code>.xsession</code>, and I have a <code>/ssh</code> automounter!  Combined with
the wonders of kerberos and public keys, so I never have to type a
password, and I can get easy remote access to just about every machine
I care about!</p>

<p>(Note that I did have to chown <code>/ssh</code> to me in order for me to be able
to run <code>afuse</code> as me, which is necessary for <code>sshfs</code> to access my
kerberos tickets and ssh keys. This is fine for my laptop, but
obviously wouldn&#8217;t work for a dialup or other multi-user machine.)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/2008/03/automounting-sshfs/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

