SSH Filesystem

Background

ThayerFS can be accessed via ssh by connecting to one of our linux compute servers. A new project that takes advantage of this ability to provide easier file access is SSHFS. Once you have SSHFS set up on a non-Thayer School operated system such as Discovery, you can access your ThayerFS files using normal Linux operations.  More information about SSHFS and FUSE can be found here: http://fuse.sourceforge.net/sshfs.html

If you are on campus, we recommend using one of the methods described on our ThayerFS Connecting page. However, if you are off campus or trying to connect to ThayerFS from a system that does not support our protocols easily, SSHFS may be a good option.

Linux

Installing

In order to use sshfs, the linux client on which you are working must have FUSE and SSHFS installed. All of our linux clients have this functionality, as does the Discovery cluster.

If you need to install FUSE and SSHFS, please see the documentation for your particular linux distribution or the SSHFS web site at: http://fuse.sourceforge.net/sshfs.html

On Ubuntu, you will need to add the Universe "component" to your software sources (see https://help.ubuntu.com/community/Repositories/Ubuntu), and then sshfs can be installed via the gui Add/Remove Programs... or at the command line:

$ sudo apt-get update
$ sudo apt-get install sshfs

To verify that SSHFS is installed, check the output of the "which" command:

$ which sshfs
/usr/bin/sshfs

If there is no output form this command, SSHFS is not installed properly.

Mounting 

To mount ThayerFS via SSHFS, you first need to create a mount point, which is just an empty directory:

$ mkdir thayerfs

Then, issue the sshfs command to create the connection (be sure to use the '-o follow_symlinks' option or things will not work properly):

sshfs -o follow_symlinks your_q_username@zog.thayer.dartmouth.edu:/thayerfs ./thayerfs
your_q_username@zog's password:
$ ls thayerfs/
apps  common  courses  home  research

The linux compute server "zog" has been used as an example, but you can use any of our linux compute servers.

Once the sshfs command completes, ThayerFS will be accessible via the local thayerfs directory you created. Keep in mind that this method will be much slower than our standard protocols.

Alternately, if you need to access only one directory, you can connect directly to it:

$ mkdir mydir
	

Then, issue the sshfs command to create the connection:

sshfs -o follow_symlinks your_q_username@zog.thayer.dartmouth.edu:/thayerfs/research/mydir ./mydir
your_q_username@zog's password:
$ ls mydir/
file1  file2  file3
	

When you are done using SSHFS, you should unmount the filesystem and then remove the mount point you created above:

$ fusermount -u ./thayerfs
$ rmdir thayerfs

Mac OS X

A Mac OS X implementation of FUSE and SSHFS is available here:

https://osxfuse.github.io/

To install this, download and install both the OSXFUSE and SSHFS packages.

Instructions for using this software is also available at the OSXFUSE site:

https://github.com/osxfuse/osxfuse/wiki/SSHFS

Permissions Issues

For certain ThayerFS shares or folders, the Mac OS X graphical sshfs client may mount properly but then you get permissions denied errors when trying to access the mounted filesystem. This issue is most-commonly caused by the way permissions are translated and interpreted by the Mac OS X Finder. To work around this issue, you need to mount the filesystem from the command line using the '-o defer_permissions' option to sshfs. So, to mount the "bigproject" research folder, you would do something like this from a shell prompt (the backslashes are for clarity - they can be omitted and everything put on one line):

$ mkdir /Volumes/bigproject
$ /Applications/sshfs.app/Contents/Resources/sshfs-static \
    d12345q@zog.thayer.dartmouth.edu:/thayerfs/research/bigproject \
    /Volumes/bigproject -o defer_permissions
	

You can then interact with this volume as you would any network-mounted volume.

Windows

The best free implementation of SSHFS on Windows is the Dokan library. This is not FUSE, but is a Windows-equivalent library that provides the same functionality.

To install this, you need to download and install both the library and SSHFS program from the Dokan site:

https://dokan-dev.github.io/

There is also a commercial product that has the same functionality called ExpanDrive:

http://www.expandrive.com/windows

Still need help? Contact Us Contact Us