<?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>damontimm.com &#187; sshfs</title>
	<atom:link href="http://blog.damontimm.com/tag/sshfs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.damontimm.com</link>
	<description>Where I go to remember what I did</description>
	<lastBuildDate>Fri, 16 Jul 2010 18:51:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to: Mount a SFTP Folder (SSH + FTP) on Ubuntu Linux using SSHFS &amp; Fuse</title>
		<link>http://blog.damontimm.com/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/</link>
		<comments>http://blog.damontimm.com/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/#comments</comments>
		<pubDate>Sun, 29 Oct 2006 17:58:17 +0000</pubDate>
		<dc:creator>Damon</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshfs]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.damontimm.com/blog/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/</guid>
		<description><![CDATA[Purpose: to mount a remote directory on my local Ubuntu Linux Desktop system using SFTP (which is SSH in an FTP-like fashion). The goal is to easily gain access to a remote system&#8217;s files through another folder on my desktop. Debina/Ubuntu allows you to easily mount SSH folders via the GUI, however, these mounts won&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose:</strong> to mount a remote directory on my local Ubuntu Linux Desktop system using SFTP (which is SSH in an FTP-like fashion).  The goal is to easily gain access to a remote system&#8217;s files through another folder on my desktop.  Debina/Ubuntu allows you to easily mount SSH folders via the GUI, however, these mounts won&#8217;t show up in the terminal (and in some programs).  I used <a href="http://fuse.sourceforge.net/sshfs.html">sshfs</a> to accomplish this.</p>
<p><span id="more-33"></span></p>
<p> <strong>Special Thanks</strong>: goes to user llamakc from ubuntuforums.org for helping me with this one night <a href="http://ubuntuforums.org/showthread.php?t=270806">in this thread</a>; also, can find <a href="https://help.ubuntu.com/community/SSHFS">Ubuntu&#8217;s SSHFS documentation here</a>.)</p>
<h3>install the sshfs software and mount</h3>
<p>After some trial and error on my part, I found that only a few simple steps are needed to get everything up and running:</p>
<p>First, get the <a href="http://fuse.sourceforge.net/sshfs.html">sshfs</a> software (which is based on <a href="http://fuse.sourceforge.net">FUSE</a>); if you have Ubuntu, this is easy because it is an included package available for easy install.  After the package is installed, you need to add your username to the <code>fuse</code> group.  On Ubuntu, you would open a terminal window and perform the following:</p>
<ul class="terminal">
<li><code>sudo aptitude update</code></li>
<li><code>sudo apititude install sshfs</code></li>
<li><code>sudo adduser <strong>yourusername</strong> fuse</code></li>
</ul>
<p>After, restart your machine.  (I have tried just logging in and logging out, but I kept getting permissions errors &#8212; all of which disappeared after a restart.)</p>
<p>The next step it so to create an empty directory that will serve as the &#8220;window&#8221; into the SFTP server.  I created a folder on my desktop called <code>sftp</code>.  Once the folder has been created, simply run <code>sshfs</code> using the appropriate login information (host username and IP), the host and local directories, and the SFTP connection is mounted on a folder on my desktop.</p>
<ul class="terminal">
<li><code>mkdir ~/Desktop/sftp</code></li>
<li><code>sshfs HOSTuser@remote.host.or.ip:/host/dir/to/mount ~/Desktop/sftp</code></li>
</ul>
<p>This folder will work like any other folder on your system; when you restart your computer (or logout and log back in) you will have to go through the last step of the process again (calling the <code>sshfs</code> program) to enable the folder on your desktop (save time by <a href="#bash">creating a bash alias</a>).</p>
<h3>possible errors and workarounds</h3>
<p>When I restarted my system the first time (using Ubuntu 6.06), after having so cleverly got <code>sshfs</code> to work, and tried to run my <code>sshfs</code> command I got an error:</p>
<ul class="terminal">
<li><code>sshfs HOSTuser@remote.host.or.ip:/host/dir/to/mount ~/Desktop/sftp</code><br />
	<code><strong>fusermount: failed to open /dev/fuse: No such file or directory</strong><br />
</code></li>
</ul>
<p>A quick search on google brought me to the <a href="http://fuse.sourceforge.net/wiki/index.php/SshfsFaq">sourceforge FAQ</a> for sshfs and there, lo and behold, the following was suggested to rectify the situation:</p>
<ul class="terminal">
<li><code>sudo mknod -m 666 /dev/fuse c 10 229<br />
</code></li>
</ul>
<p>After running this command, I was able to mount my SFTP directory.  I never received this error using Ubuntu 6.10.</p>
<p>If you get any permission denied warnings, be sure you have added your username to the <code>fuse</code> group and also restarted your system. </p>
<h3 id="bash">create a bash alias to save time and typing</h3>
<p>To save time, I created a bash alias that would remember all the details for me.  </p>
<p>First, make make sure my system reads from the <code>~/.bash_aliases</code> file (it may not be default).  Open <code>~/.bashrc</code> and ensure the following lines are uncommented:</p>
<ul class="code">
<li><code># Alias definitions.</code></li>
<li><code># You may want to put all your additions into a separate file like</code></li>
<li><code># ~/.bash_aliases, instead of adding them here directly.</code></li>
<li><code># See /usr/share/doc/bash-doc/examples in the bash-doc package.</code></li>
<li><code></code></li>
<li class="modified"><code>if [ -f ~/.bash_aliases ]; then</code></li>
<li class="modified"><code>    . ~/.bash_aliases</code></li>
<li class="modified"><code>fi</code></li>
</ul>
<p>Next, create (or modify if you already have one) your <code>~/.bash_aliases</code> file.  </p>
<ul class="terminal">
<li><code>nano ~/.bash_aliases</code></li>
</ul>
<p>I added the following single line of code to the document (first call the mknod, if you are getting the error, then the sshfs):</p>
<ul class="code">
<li><code>alias sftp='sudo mknod -m 666 /dev/fuse c 10 229; sshfs HOSTuser@remote.host.or.ip:/host/dir/to/mount ~/Desktop/sftp'<br />
</code></li>
</ul>
<p>Now, when I open the terminal, I just type:</p>
<ul class="terminal">
<li><code>sftp</code></li>
</ul>
<p>And everything loads correctly.  Is very fast and very nice.  I like it.  </p>
<h3>finally:</h3>
<p>Changes to your <code>~/.bash_aliases</code> file will only take effect after you have reopened the terminal or called:</p>
<ul class="terminal">
<li><code>. ~/.bash_aliases</code></li>
</ul>
<p>If you ever want to unmount the directory without logging out or restarting, use the following:</p>
<ul class="terminal">
<li><code> fusermount -u ~/Desktop/sftp</code></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.damontimm.com/how-to-mount-a-sftp-folder-ssh-ftp-on-ubuntu-linux-using-sshfs-fuse/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
