{"id":338,"date":"2012-09-17T10:00:58","date_gmt":"2012-09-17T15:00:58","guid":{"rendered":"https:\/\/www.foell.org\/justin\/?p=338"},"modified":"2020-04-20T11:04:11","modified_gmt":"2020-04-20T16:04:11","slug":"cross-platform-file-sharing-with-sshfs","status":"publish","type":"post","link":"https:\/\/www.foell.org\/justin\/cross-platform-file-sharing-with-sshfs\/","title":{"rendered":"Cross-platform file sharing with SSHFS"},"content":{"rendered":"<h2>Update<\/h2>\n<p>I have a <a href=\"https:\/\/www.foell.org\/justin\/raspberrypi-incrediblepbx-phone-fax-nas\/\">new post about SSHFS that highlights the latest operating systems, including MacOS<\/a>. However, I&#8217;m leaving this post here for historical purposes.<\/p>\n<h2>Original<\/h2>\n<p>At home I have what some may call a &#8220;back-office&#8221; server.\u00a0 Technically it&#8217;s in the laundry room, but it does all sorts of home automation type stuff: record TV, download files, store and play music, distribute files, run backups, etc.\u00a0 I may do a post on it later, but the gist is that it&#8217;s running <a title=\"Ubuntu Server\" href=\"http:\/\/www.ubuntu.com\/download\/server\">Ubuntu Server<\/a> with a bunch of disk drives.<\/p>\n<p>Far and above, it&#8217;s main purpose in life is being a file server.\u00a0 There are several ways to connect to it: Samba (Windows file sharing), <a title=\"Network File System\" href=\"http:\/\/en.wikipedia.org\/wiki\/Network_File_System\">NFS<\/a> (Unix Network File System).\u00a0 The server also runs SSH (Secure Shell) for terminal access &#8211; which can also be used a pass-through for secure local and remote file sharing.<\/p>\n<p><!--more--><\/p>\n<h3>The Advantage of SSHFS<\/h3>\n<p>Windows shares don&#8217;t have options to change ports, SSH does &#8211; and internet service providers often block Windows file sharing ports both for their own customers safety and to CYOA (cover your [their] own a$$) regarding file sharing.\u00a0 SSH, however, can be run on any port and it&#8217;s <em>secure<\/em>.\u00a0 I simply set up a firewall rule on my <a title=\"Pimp your LAN with OpenWRT &amp; Dnsmasq\" href=\"https:\/\/www.foell.org\/justin\/pimp-your-lan-with-openwrt-and-dnsmasq\/\">router (OpenWrt)<\/a> to pass SSH traffic to my file server.<\/p>\n<h3>Why not use &#8220;the cloud?&#8221;<\/h3>\n<p>I firmly believe that by putting your files in &#8220;the cloud&#8221; (whether it be with Google, Apple, Amazon, Dropbox, etc.) you lose a little freedom.\u00a0 That doesn&#8217;t mean I don&#8217;t use any of those services, I just use them <em>selectively<\/em>.\u00a0 For the record Dropbox is a great service that works cross-platform and you&#8217;ll get some extra space if you sign up using this <a title=\"Dropbox\" href=\"http:\/\/db.tt\/Y3Oj1bh\">link<\/a>.<\/p>\n<h2>Connecting with SSHFS in Linux<\/h2>\n<p>The simplest way to connect to another computers file-system using SSHFS is to do it through the UI using the Nautilus file manager.\u00a0 This is default file manager for several Linux distributions.\u00a0 In Ubuntu with Unity,\u00a0 click the folder icon in the launcher to bring a\u00a0Nautilus window showing your home folder.\u00a0 From Nautilus you can click the file menu and choose <em>Connect to Server&#8230;<\/em><\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_menu.png\" rel=\"gallery-338\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"339\" data-permalink=\"https:\/\/www.foell.org\/justin\/cross-platform-file-sharing-with-sshfs\/nautilus_menu\/\" data-orig-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_menu.png\" data-orig-size=\"1100,510\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"nautilus_menu\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_menu-300x139.png\" data-large-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_menu-1024x474.png\" class=\"alignnone size-medium wp-image-339\" title=\"nautilus_menu\" src=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_menu-300x139.png\" alt=\"\" width=\"300\" height=\"139\" srcset=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_menu-300x139.png 300w, https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_menu-1024x474.png 1024w, https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_menu.png 1100w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Which will bring up a dialog where you can input the info for your SSH server.\u00a0 Change the <em>Type<\/em> drop-down to &#8220;SSH&#8221; and you&#8217;ll see all of these options:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/connect_to_server.png\" rel=\"gallery-338\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"340\" data-permalink=\"https:\/\/www.foell.org\/justin\/cross-platform-file-sharing-with-sshfs\/connect_to_server\/\" data-orig-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/connect_to_server.png\" data-orig-size=\"442,327\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"connect_to_server\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/connect_to_server-300x221.png\" data-large-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/connect_to_server.png\" class=\"alignnone size-medium wp-image-340\" title=\"connect_to_server\" src=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/connect_to_server-300x221.png\" alt=\"\" width=\"300\" height=\"221\" srcset=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/connect_to_server-300x221.png 300w, https:\/\/www.foell.org\/justin\/files\/2012\/09\/connect_to_server.png 442w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Once you&#8217;ve connected, you&#8217;ll have a folder on the left side of Nautilus (under Network) that you can click on to browse files on the file server.\u00a0 You can right click the folder and choose\u00a0<em>Add Bookmark<\/em> which will make it a breeze to connect to again and again:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_bookmark.png\" rel=\"gallery-338\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"341\" data-permalink=\"https:\/\/www.foell.org\/justin\/cross-platform-file-sharing-with-sshfs\/nautilus_bookmark\/\" data-orig-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_bookmark.png\" data-orig-size=\"960,716\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"nautilus_bookmark\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_bookmark-300x223.png\" data-large-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_bookmark.png\" class=\"alignnone size-medium wp-image-341\" title=\"nautilus_bookmark\" src=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_bookmark-300x223.png\" alt=\"\" width=\"300\" height=\"223\" srcset=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_bookmark-300x223.png 300w, https:\/\/www.foell.org\/justin\/files\/2012\/09\/nautilus_bookmark.png 960w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>You&#8217;ll notice I have two folders under &#8220;Bookmarks&#8221;: sshfs-Local and sshfs-Remote.\u00a0 I set up an additional connection for when I&#8217;m away from home which uses my outside IP and port I set up on my firewall\/router.<\/p>\n<p>Nautilus uses the <a title=\"GVFS (Wikipedia)\" href=\"http:\/\/en.wikipedia.org\/wiki\/GVFS\">GVFS<\/a> <a title=\"FUSE (Wikipedia)\" href=\"http:\/\/en.wikipedia.org\/wiki\/Filesystem_in_Userspace\">FUSE<\/a> (filesystem in userspace) module to mount the remote drive.\u00a0 To make it easy to access from the command line I created a symbolic link from ~\/Documents\/sshfs-Local-Documents to my SSHFS directory.\u00a0 All of the GVFS mounts (on Ubuntu 12.04 and earlier) can be found in your ~\/.gvfs folder.\u00a0 Mine is linked as such:<\/p>\n<pre>justin@lappy64:~$ ls -l ~\/Documents\/sshfs-Local-Documents\nlrwxrwxrwx 1 justin justin 72 Oct 17\u00a0 2011 \/home\/justin\/Documents\/sshfs-Local-Documents -&gt; \/home\/justin\/.gvfs\/SFTP for justin on ghettivo\/srv\/home\/justin\/Documents<\/pre>\n<p>Starting with Ubuntu 12.10, the GVFS mounts are in \/var\/run\/user. So my symlink in 12.10 looks like:<\/p>\n<pre>justin@lappy64:~$ ls -l ~\/Documents\/sshfs-Local-Documents\nlrwxrwxrwx 1 justin justin 82 Nov  1 09:44 \/home\/justin\/Documents\/sshfs-Local-Documents -&gt; \/var\/run\/user\/justin\/gvfs\/sftp:host=ghettivo,user=justin\/srv\/home\/justin\/Documents<\/pre>\n<h2>Connection with SSHFS in Windows<\/h2>\n<p>To connect to the same files using Windows, there&#8217;s <a title=\"Dokan SSHFS\" href=\"http:\/\/dokan-dev.net\/en\/\">Dokan SSHFS<\/a>.\u00a0 I will say that at the moment this library is a little buggy, but it will work in a pinch.\u00a0 I get the feeling that it probably works better in 32-bit windows, but I don&#8217;t have any claims to back that up &#8211; I just know it&#8217;s a bit unstable in 64-bit windows.<\/p>\n<p>Since Dokan is a .NET application, you&#8217;ll need to install a couple of things (maybe 3), slightly better than installing a Java application \ud83d\ude09<\/p>\n<ol>\n<li><a title=\"Dokan Library\" href=\"http:\/\/dokan-dev.net\/wp-content\/uploads\/DokanInstall_0.6.0.exe\">Dokan Library<\/a><\/li>\n<li><a title=\"Dokan SSHFS\" href=\"http:\/\/dokan-dev.net\/wp-content\/uploads\/dokan-sshfs-0.6.0.zip\">Dokan SSHFS<\/a><\/li>\n<li><a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Visual C++ 2005 SP1 Redistributable Package<\/a><\/li>\n<\/ol>\n<p>There&#8217;s a small chance that you have the latest &#8220;Redistributable Package&#8221; already on your Windows computer, so you can maybe skip it, but honestly it doesn&#8217;t hurt to install.<\/p>\n<p>Once you&#8217;ve got everything installed you can run <code>DokanSSHFS.exe<\/code> to\u00a0connect to your SSHFS drive:<\/p>\n<p><a class=\"thickbox\" href=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/dokansshfs.png\" rel=\"gallery-338\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"349\" data-permalink=\"https:\/\/www.foell.org\/justin\/cross-platform-file-sharing-with-sshfs\/dokansshfs\/\" data-orig-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/dokansshfs.png\" data-orig-size=\"375,395\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"dokansshfs\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/dokansshfs-284x300.png\" data-large-file=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/dokansshfs.png\" class=\"alignnone size-medium wp-image-349\" title=\"dokansshfs\" src=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/dokansshfs-284x300.png\" alt=\"\" width=\"284\" height=\"300\" srcset=\"https:\/\/www.foell.org\/justin\/files\/2012\/09\/dokansshfs-284x300.png 284w, https:\/\/www.foell.org\/justin\/files\/2012\/09\/dokansshfs.png 375w\" sizes=\"auto, (max-width: 284px) 100vw, 284px\" \/><\/a><\/p>\n<p>Happy (secure) file sharing!<\/p>\n<div class='kindleWidget kindleLight' ><img decoding=\"async\" src=\"https:\/\/www.foell.org\/justin\/wp-content\/plugins\/send-to-kindle\/media\/white-15.png\" \/><span>Send to Kindle<\/span><\/div>","protected":false},"excerpt":{"rendered":"<p>Update I have a new post about SSHFS that highlights the latest operating systems, including MacOS. However, I&#8217;m leaving this post here for historical purposes. Original At home I have what some may call a &#8220;back-office&#8221; server.\u00a0 Technically it&#8217;s in the laundry room, but it does all sorts of home automation type stuff: record TV,&hellip; <a href=\"https:\/\/www.foell.org\/justin\/cross-platform-file-sharing-with-sshfs\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1,8],"tags":[166,24,50,141],"class_list":["post-338","post","type-post","status-publish","format-standard","hentry","category-business","category-ubuntu","tag-linux","tag-openwrt","tag-ssh","tag-windows"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts\/338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/comments?post=338"}],"version-history":[{"count":19,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts\/338\/revisions"}],"predecessor-version":[{"id":3749,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/posts\/338\/revisions\/3749"}],"wp:attachment":[{"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/media?parent=338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/categories?post=338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.foell.org\/justin\/wp-json\/wp\/v2\/tags?post=338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}