Mapping HPC drives with SSHFS
Besides mapping HPCC drives with SMB, SSHFS can also enable mounting of HPCC file systems on a local computer. Different from SMB mapping, which can only map to home or research space via the MSU campus network, this method can also work on your scratch space and uses any internet network.
Warning
You will need to generate an authentication key by following the direction of SSH Key-Based Authentication if you do not already have one set up.
-
Download and install (or upgrade) the most recent versions of the following packages: FUSE for macOS and SSHFS from https://osxfuse.github.io.
-
Reboot (required)
-
Using the Terminal, create a directory (as
<local_mount_point>in step 4) for each filesystem you wish to mount. If you are creating the folder outside of your home directory, you may need to usesudobefore each command (sudo = superuser do ) and may also need to open the access permission accordingly.[MacBook-Pro:~ icer2]$ mkdir <local_mount_point> /* begin example home directory */ [MacBook-Pro:~ icer2]$ mkdir /Users/icer2/hpcc_home /* end example home directory */ /* begin example scratch directory in the Mac /Volumes folder where drives are mounted */ [MacBook-Pro:~ icer2]$ mkdir /Users/icer2/hpcc_scratch /* end example scratch directory */ -
Mount the directory using the
sshfscommand. We suggest you add these additional flags to the command to make it be more "Mac-like" :-ocache=no,-onolocalcachesand-o volname=hpcc_home. For the last option, '-o volname' is the name that displays in the Finder title bar, so change it for difference file folders (e.g. use-o volname=hpcc_scratchfor your scratch folder). After running the command, enter the password for logging into HPCC and the FUSE drive icon will show on the desktop of your local Mac computer.[MacBook-Pro:~ icer2]$ sshfs <user_id>@rsync.hpcc.msu.edu:<remote_directory_to_mount> <local_mount_point> -ovolname=hpcc -o allow_other,defer_permissions,follow_symlinks,reconnect -ocache=no -onolocalcaches /* begin example hpc's home directory, using /mnt/home/hpc/ */ [MacBook-Pro:~ icer2]$ sshfs hpc@rsync.hpcc.msu.edu:/mnt/home/hpc/ /Users/icer2/hpcc_home -o volname=hpcc_home -o allow_other,defer_permissions,follow_symlinks,reconnect -ocache=no -onolocalcaches /* end example home directory */ /* begin example hpc's scratch directory with authorized key file ~/.ssh/id_rsa, using /mnt/gs18/scratch/users/hpc */ [MacBook-Pro:~ icer2]$ mkdir /Users/icer2/hpcc_scratch [MacBook-Pro:~ icer2]$ sshfs hpc@rsync.hpcc.msu.edu:/mnt/gs18/scratch/users/hpc /Users/icer2/hpcc_scratch -o volname=hpcc_scratch -o allow_other,defer_permissions,follow_symlinks,reconnect,IdentityFile=~/.ssh/id_rsa -ocache=no -onolocalcaches (No password input) /* end example scratch directory */If
<remote_directory_to_mount>is a static link, please make sure
to put / at the end of the directory path:
- For your home space, please use `/mnt/home/<user_id>/` instead of
`/mnt/home/<user_id>`.
- For your research space, please use `/mnt/research/<group_name>/`
instead of `/mnt/research/<group_name>`.
As the above example (starting from line 5), home space
`/mnt/home/hpc/` is used on line 7 instead of `/mnt/home/hpc`.
-
To unmount a filesystem, use the
umountcommand.Note
It's just the letter u before mount, NOT
unmount.umount <local_mount_point> /* begin example */ umount /Users/icer2/hpcc_home /* end example */You'll see these folders in the finder if you use the Go menu, but you
won't see them listed in the left side with the other mounted drives.
You must use the terminal and umount command to disconnect.
References:
Please refer to this web site:
https://tecadmin.net/install-sshfs-on-linux-and-mount-remote-filesystem/
for how to mount remote filesystem over SSH on Linux.
We no longer recommend using SSHFS on Windows, please see instructions for using Samba instead