{"id":5682,"date":"2015-05-03T10:42:31","date_gmt":"2015-05-03T07:42:31","guid":{"rendered":"http:\/\/www.hbyconsultancy.com\/?p=5081"},"modified":"2015-05-03T10:42:31","modified_gmt":"2015-05-03T07:42:31","slug":"sshfs-mount-remote-directories-locally-with-ssh","status":"publish","type":"post","link":"https:\/\/hbyconsultancy.com\/2015\/05\/sshfs-mount-remote-directories-locally-with-ssh.html","title":{"rendered":"SSHFS Mount remote directories locally with SSH"},"content":{"rendered":"

Sometimes it’s annoying to work from your Desktop on remote files using command line only, while you can access them easily using GUI. The problem occur if you are editing text files that have non standard encoding, and in this case using command line might broke your encoding or not allow you to see text correctly. So instead of finding a way to display it in command line, I prefer using other editors.<\/p>\n

So to mount your remote directory using SSH you will need to have sshfs, I am using here Ubuntu trusty 14.04.2 :<\/p>\n

sudo apt-get install sshfs<\/pre>\n

Load the kernel module :<\/p>\n

sudo modprobe fuse<\/pre>\n

Then set the permissions required, replace “username”<\/em> with your current user name :<\/p>\n

sudo adduser username fuse\n\nsudo chown root:fuse \/dev\/fuse<\/pre>\n

Then finally you can mount it locally :<\/p>\n

mkdir ~\/remote10\n\nsshfs remoteuser@10.10.xx.xx:\/var\/www\/html\/project10 ~\/remote10<\/pre>\n

You might see your remote directory mounted below devices :<\/p>\n

\"sshfs\"<\/a><\/p>\n

Now when you finish you can unmount it using :<\/p>\n

fusermount -u  ~\/remote10<\/pre>\n

The end.<\/p>\n","protected":false},"excerpt":{"rendered":"

Sometimes it’s annoying to work from your Desktop on remote files using command line only, while you can access them easily using GUI. The problem occur if you are editing text files that have non standard encoding, and in this case using command line might broke your encoding or not allow you to see text […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,10],"tags":[226,227],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/posts\/5682"}],"collection":[{"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/comments?post=5682"}],"version-history":[{"count":0,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/posts\/5682\/revisions"}],"wp:attachment":[{"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/media?parent=5682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/categories?post=5682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hbyconsultancy.com\/wp-json\/wp\/v2\/tags?post=5682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}