{"id":393,"date":"2012-04-24T18:18:07","date_gmt":"2012-04-24T23:18:07","guid":{"rendered":"http:\/\/littlesvr.ca\/grumble\/?p=393"},"modified":"2012-12-05T00:46:30","modified_gmt":"2012-12-05T05:46:30","slug":"replacing-nfs-with-sshfs","status":"publish","type":"post","link":"http:\/\/littlesvr.ca\/grumble\/2012\/04\/24\/replacing-nfs-with-sshfs\/","title":{"rendered":"Replacing NFS with SSHFS"},"content":{"rendered":"<p>For years I knew about the security issues related to NFS, but there wasn&#8217;t really a solution to that and I didn&#8217;t have a multiuser environment to worry about so I lived with it.<\/p>\n<p>More recently though I&#8217;ve <a href=\"http:\/\/littlesvr.ca\/grumble\/2011\/12\/08\/gui-for-editing-php-live-on-the-server\/\">experimented with sshfs<\/a> and found it to work really well. So I figured why not try to replace my NFS entry from \/etc\/fstab with an SSHFS entry?<\/p>\n<p>Not all that hard to do, though there have been a couple of quirks. First I added this to \/etc\/fstab:<\/p>\n<blockquote><p>sshfs#user@ip:\/dir \u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 \/home\/user\/dir fuse\u00a0\u00a0\u00a0\u00a0 defaults,idmap=user,noauto,user 0 0<\/p><\/blockquote>\n<p>Note that it&#8217;s not mounted automatically. That&#8217;s because to mount something using SSHFS you need to give a password or use an SSH key, and root (who runs the startup scripts) doesn&#8217;t have my user&#8217;s private key.<\/p>\n<p>This works great for mounting it manually (mount \/home\/user\/dir) but not so well for an automount at boot. For that first I tried to add the mount command to my XFCE startup scripts, but it turns out it didn&#8217;t run quickly enough. Next thing I tried was to add it to .xinitrc but it seemed to be ignored.<\/p>\n<p>A bit of searching and I found a solution &#8211; use ~\/.xprofile instead. So this is what mine looks like:<\/p>\n<blockquote><p>~$ cat .xprofile<br \/>\nmount \/home\/user\/dir<\/p><\/blockquote>\n<p>And it works great! Now if only I could find a solution for that ridiculous plain-text SMTP protocol&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For years I knew about the security issues related to NFS, but there wasn&#8217;t really a solution to that and I didn&#8217;t have a multiuser environment to worry about so I lived with it. More recently though I&#8217;ve experimented with sshfs and found it to work really well. So I figured why not try to &hellip; <\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-andrew","4":"post-393","6":"format-standard","7":"category-opensource","8":"category-safeforseneca"},"_links":{"self":[{"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/posts\/393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/comments?post=393"}],"version-history":[{"count":3,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/posts\/393\/revisions"}],"predecessor-version":[{"id":568,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/posts\/393\/revisions\/568"}],"wp:attachment":[{"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/media?parent=393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/categories?post=393"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/littlesvr.ca\/grumble\/wp-json\/wp\/v2\/tags?post=393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}