Skip to main content

Mounting a workstation file system to your local computer with SSHFS

To easily transfer files between a workstation and your local computer, we recommend using the SSH Filesystem (SSHFS). SSHFS enables you to mount the file system for the workstation as a directory on your computer. With SSHFS, any file that you place in this mounted directory will be available to both your workstation and your computer. This page describes how to install, configure, and best work with SSHFS from Linux and macOS computers.

Install SSHFS onto your local computer

Linux

We recommend using your distribution's package manager to install SSHFS. For example, Debian and Ubuntu users should run sudo apt install sshfs and CentOS, Fedora, and RedHat users should run sudo yum install sshfs.

macOS

We recommend installing SSHFS by installing macFUSE. macFUSE includes SSHFS.

  1. Visit the macFUSE website.
  2. From the macFUSE home page, download the latest stable release to your local computer.
  3. Double-click on the downloaded file.
  4. Complete the on-screen instructions.
Support for local Windows computers

Please use our support portal to request help transferring files between workstations and Windows computers.

Set up SSHFS for access to one workstation

  1. Start your workstation.
  2. Configure SSH access for your account by adding your public SSH key to your account. Learn more.
  3. Configure your local computer for advanced SSH access to your workstation. Learn more.
  4. On your local computer, create the directory that you will mount the file system in your workstation to. For example, run mkdir --parents ~/workstations/{workstation-id}.
  5. On your local computer, start SSHFS by running sshfs {workstation domain}:{workstation directory} {local directory}. For example, run sshfs {workstation-id}-{blueprint-id}.org-{org-id}.{compute-cluster-id}.bench.deeporigin.io:/home/bench-user ~/workstations/{workstation-id}/, replacing the following variables:
    • org-id: Replace with the ID of your organization, such as acme-bio.
    • workstation-id: Replace with the ID of your workstation, such as exceptional-panda-g1i.
    • blueprint-id: Replace with the ID of the blueprint, such as python.
    • compute-cluster-id: Replace with the ID of your compute cluster, such as us-west-2.aws.
  6. Check that SSHFS is working by copying a small file into this local directory and checking that you can open it from your workstation.
  7. To disable SSHFS, run umount on the local mounted directory. For example, run umount ~/workstations/{workstation-id}/.

To enhance your experience, we recommend using SSHFS with the options described below. These options can be set by running sshfs with the -o argument, such as sshfs -o reconnect. Multiple options can be set by separating them with commas, such as sshfs -o reconnect,follow_symlinks.

  • reconnect: Automatically reconnect to your workstation when the connection is interrupted. This is particularly helpful for poor internet connections.
  • follow_symlinks: Follow symbolic links in your workstation.

Bash functions for easy SSHFS mounting

Through the use of bash functions, you can create a simple command for creating local directories for mounting workstations and launching SSHFS, such the cb_sshfs function outlined below.

To install this command, add the following lines to your ~/.bash_aliases file on Linux or your ~/.bash_profile file on macOS.

function cb_sshfs() {
mkdir -p ~/workstations/$1/ && \
sshfs -o reconnect,follow_symlinks $1.org-{organization ID}.{compute-cluster-id}.bench.deeporigin.io:/home/bench-user ~/workstations/$1/;
}

Replace {organization ID} with the ID of your organization. You can find an example of the proper command in the SSH instructions for a workstation.

To use this command, start a new terminal and run cb_sshfs {workstation ID} such as cb_sshfs fashionable-tarantula-eku.

Troubleshooting SSHFS

If you cannot set up SSHFS, first ensure that normal SSH connections to your workstation work as expected. For example, verify that you can connect to your workstation by running ssh {workstation domain}. Next, run sshfs with the --debug flag to get more information about the attempted connection.

If an SSHFS connection becomes unresponsive, try disconnecting and reconnecting SSHFS by running umount {path to local mount directory} and sshfs .... If umount doesn't work, you can kill SSHFS by finding the ID of the process with a tool such as htop and killing the process with the kill command.

Automatically start SSHFS when your local computer starts

By default, SSHFS must be launched each time your computer starts. fstab can be used to automatically start SSHFS each time your local computer starts. To configure fstab to automatically launch SSHFS for a workstation, add the following to your /etc/fstab file:

sshfs#bench-user@{workstation domain}:{workstation directory} {local mount directory} fuse defaults,{SSHFS options} 0 0

such as

sshfs#bench-user@{workstation-id}-{blueprint-id}.org-{org-id}.{compute-cluster-id}.bench.deeporigin.io:/home/bench-user /home/user/workstations/{workstation-id} fuse defaults,reconnect,follow_symlinks 0 0

replacing the following variables:

  • org-id: Replace with the ID of your organization, such as acme-bio.
  • workstation-id: Replace with the ID of your workstation, such as exceptional-panda-g1i.
  • blueprint-id: Replace with the ID of the blueprint, such as python.
  • compute-cluster-id: Replace with the ID of your compute cluster, such as us-west-2.aws.