This is an old revision of the document!


Mounting a Remote Filesystem Locally

It can often be beneficial to mount a remote filesystem locally to your computer, allowing you to treat the contents as if they were local to your machine. This would, for example, allow you to use a local IDE to edit/compile/run files hosted on stu.cs.jmu.edu. This article describes how to mount your JMUCS home directory using sshfs.

Prerequisites

  1. SSH access to the server hosting the filesystem you wish to mount. It can be helpful to set up ssh keypairs as well.
  2. Install the sshfs client on your local machine. See the appropriate section below for your Operating System.

Linux

Most distributions package sshfs in their repositories and installing from there is far easier than compiling it yourself. For Ubuntu/Mint you could run apt-get install sshfs.

Mounting the remote filesystem

You must create a local mountpoint before mounting the remote filesystem (this must be done only once). Then the filesystem can be mounted.

mkdir -p ~/mnt/stu
sshfs <eid>@stu.cs.jmu.edu: ~/mnt/stu

Where <eid> is your JMU username. The ~/mnt/stu directory on your local machine now contains the contents of your JMUCS home directory. Changes made in one place will automatically be reflected in the other.

See man sshfs for additional options; in particular, the -o idmap=user option is necessary if your UIDs do not match between the client and the server (this is likely the case on personal machines).

Unmounting the filesystem

When you are done using the remote filesystem you should unmount it using the fuermount command.

fusermount -u ~/mnt/stu

macOS

Download and install both the “FUSE for macOS” and “SSHFS” packages from this page, following the instructions as prompted. When prompted, enable the “FUSE for macOS Preference Pane” to facilitate future updates. You will also need to enable a system extension in your Security & Privacy System Preferences.''

After everything is installed correctly, you should be able to follow the same command-line instructions described in the Linux section above.

Windows

  1. Ordered List ItemDownload the latest release of WinFsp from here: https://github.com/billziss-gh/winfsp/releases
  2. Download the latest release of SSHFS-Win from here, picking your version's architecture (Likely x64): https://github.com/billziss-gh/sshfs-win/releases
  3. Install WinFsp. The default selection of components can be used.
  4. Install SSHFS-Win, the default options are fine.
  5. Right click on computer, and:
    • Select “Map Network Drive”
    • Select a drive letter that is convenient.
    • In the folder box, type in the following, substituting your EID:
      \\sshfs\eid@stu.cs.jmu.edu
    • Click finish, and type in your EID password.
  6. You should now have your stu home directory mounted at the drive letter you specified