{"id":3800,"date":"2020-09-29T13:16:36","date_gmt":"2020-09-29T07:46:36","guid":{"rendered":"https:\/\/www.suramya.com\/blog\/?p=3800"},"modified":"2022-06-16T15:21:33","modified_gmt":"2022-06-16T09:51:33","slug":"mounting-a-network-drive-over-ssh-in-windows-using-winfsp-sshfs-win","status":"publish","type":"post","link":"https:\/\/www.suramya.com\/blog\/2020\/09\/mounting-a-network-drive-over-ssh-in-windows-using-winfsp-sshfs-win\/","title":{"rendered":"Mounting a Network drive over ssh in Windows using WinFsp &#038; SSHFS-Win"},"content":{"rendered":"<p>I have computers running both Windows &#038; Linux and at times I need to share files between them and I have been looking for a convenient way to access the files from my Linux machine from my Windows machine without having to run SAMBA on the Linux. This is because historically SAMBA has been a security nightmare and I don&#8217;t want to run extra services on the computer if I can avoid it. Earlier this week I finally found a way to mount my Linux directories on Windows as a network mount over SSH using WinFsp &#038; SSHFS-Win and I have been running it for a couple of days so far without any issues. (So far)<\/p>\n<p>Follow these steps to enable SSHFS-Win on your windows machine:<\/p>\n<p><strong>Install WinFsp (Windows File System Proxy)<\/strong><\/p>\n<p>WinFsp is a set of software components for Windows computers that allows the creation of user mode file systems similar to FUSE (Filesystem in Userspace) in the Unix\/Linux world. You can download it from the project&#8217;s <a href=\"https:\/\/github.com\/billziss-gh\/winfsp\">GIT repository<\/a>. The Installation file is available by clicking on the download link under &#8216;Releases&#8217; near the top right corner of the page. The latest version is <a href=\"https:\/\/github.com\/billziss-gh\/winfsp\/releases\/tag\/v1.7\">WinFsp 2020.1<\/a> at the time of this writing. <\/p>\n<p>You install the software by running the MSI file you downloaded and the default options worked for me without modification. <\/p>\n<p><strong>Install SSHFS For Windows<\/strong><\/p>\n<p>SSHFS-Win is a minimal port of SSHFS to Windows. It is available for download from the project&#8217;s <a href=\"https:\/\/github.com\/billziss-gh\/sshfs-win\">Git repository<\/a>. You can compile from source or download the installation file by clicking on the download link under &#8216;Releases&#8217; near the top right corner of the page. The latest version is <a href=\"https:\/\/github.com\/billziss-gh\/sshfs-win\/releases\/tag\/v3.5.20024\"> SSHFS-Win 2020<\/a> at the time of this writing. <\/p>\n<p>Please note that you will need to have WinFsp installed already before you can install SSHFS-Win successfully. <\/p>\n<p><b>Usage:<\/b><\/p>\n<p>Once you have installed both the software you can start using them and map a network drive to a directory using Windows Explorer or the net use command. Instructions for use are as below (Taken from the project Documentation):<\/p>\n<p>In Windows Explorer select This PC > Map Network Drive and enter the desired drive letter and SSHFS path using the following UNC syntax:<\/p>\n<pre class='code'>\\\\sshfs\\REMUSER@HOST[\\PATH]<\/pre>\n<p>The first time you map a particular SSHFS path you will be prompted for the SSH username and password which can be saved using the Windows Credential Manager so that you don&#8217;t get prompted for it again. In order to unmap the drive, right-click on the drive icon in Windows Explorer and select Disconnect.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.suramya.com\/blog\/wp-content\/uploads\/2020\/09\/cap.gif\" alt=\"\" width=\"800\" height=\"600\" class=\"alignnone size-full wp-image-3818\" \/><br \/>\nVisual demo of how to Map a Network drive using SSHFS-Win <\/center><\/p>\n<p>You can map a network drive from the command line as well using the net use command:<\/p>\n<pre class='code'>net use X: \\\\sshfs\\suramya@StarKnight<\/pre>\n<p>You will then be prompted for the password and once you authenticate you can use the new drive as usual. You can unmap the drive as follows:<\/p>\n<pre class='code'>net use X: \/delete<\/pre>\n<p>I find this quite useful and hope you do as well. <\/p>\n<p>Thanks to <a href='http:\/\/makerlab.cs.hku.hk\/index.php\/en\/mapping-network-drive-over-ssh-in-windows'>MakerLab, Department of Computer Science, HKU<\/a> for pointing me in the correct direction<\/p>\n<p>&#8211; Suramya<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have computers running both Windows &#038; Linux and at times I need to share files between them and I have been looking for a convenient way to access the files from my Linux machine from my Windows machine without having to run SAMBA on the Linux. This is because historically SAMBA has been a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[18,9,24,13,2],"tags":[],"class_list":["post-3800","post","type-post","status-publish","format-standard","hentry","category-computer-software","category-computer-hintstips","category-knowledgebase","category-linuxunix-related","category-techie-stuff"],"_links":{"self":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/3800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/comments?post=3800"}],"version-history":[{"count":2,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/3800\/revisions"}],"predecessor-version":[{"id":3819,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/3800\/revisions\/3819"}],"wp:attachment":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/media?parent=3800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/categories?post=3800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/tags?post=3800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}