Skip to content

Mounting remote filesystems locally#

Mounting a remote filesystem makes it available locally on your machine. From there you can access the remote files transparently within your local applications.

For copying/moving data between local and remote locations, with scp, rsync, or WinSCP, see Copying.

Why we connect to csnhr.nhr.fau.de.

We use dialog server csnhr.nhr.fau.de as remote host in all examples, as

All steps described on this page assume:

  • Your SSH connection is already configured and you are using SSH keys.
  • You successfully can connect to csnhr.nhr.fau.de with the command ssh csnhr.nhr.fau.de.

SSHFS#

With SSHFS you can mount remote directories like $HOME, $HPCVAULT, or $WORK on your local system and transparently use it with your local tools. SSHFS uses the FUSE subsystem to mount file systems with user privileges.

Requirements:

  • Operating system: Linux, macOS, or Windows Subsystem for Linux (WSL)
  • sshfs package has to installed. In some distributions the package is called sshfs-fuse.
  • On your local system SSH should be configured and you should be able to connect to our dialog server csnhr.nhr.fau.de via SSH.

Usage:

  • mount a remote directory to a local destination on your system execute:

    sshfs csnhr.nhr.fau.de:<remote_directory> <local_directory>
    

    We recommend setting options to increase connection stability and map your local to the remote user:

    • Linux:

      sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,idmap=user,cache=yes \
      csnhr.nhr.fau.de:<remote_directory> <local_directory>`
      

    • macOS:

      sshfs -o noappledouble,noapplexattr,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,kernel_cache,idmap=user,cache=yes \
      csnhr.nhr.fau.de:<remote_directory> <local_directory>
      

  • unmount the remote directory on your local system by executing:

    fusermount -u <local_directory>
    

Example mounting your $HOME locally on your system
  1. On our systems, determine where $HOME points to by copying the output from the command:
    echo $HOME
    # output:
    # /home/hpc/<group>/<user>
    
  2. On your local system run:
    sshfs csnhr.nhr.fau.de:/home/hpc/<group>/<user> <local_directory>
    

To automatically apply options to sshfs you can create an alias, which you can add to your ~/.bashrc:

  • Linux:

    alias sshfs="sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,idmap=user,cache=yes"
    

  • macOS:

    alias sshfs="sshfs -o noappledouble,noapplexattr,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,kernel_cache,idmap=user,cache=yes"
    

Linux GUIs#

Most default file mangers of Linux desktop environments allow you to connect to csnhr.nhr.fau.de through the sftp or ssh protocol.

By specifying sftp://csnhr.nhr.fau.de or ssh://csnhr.nhr.fau.de you will typically mount your remote $HOME. To mount a different remote path <path>, like $HOME, $HPCVAULT, or $WORK use sftp://csnhr.nhr.fau.de/<path> or ssh://csnhr.nhr.fau.de/<path>.

Gnome Files (Gnome)#

  1. Open file manager.
  2. Click on Other Locations.
  3. For Connect to Server enter sftp://csnhr.nhr.fau.de or ssh://csnhr.nhr.fau.de and click Connect.

Where to enter remote URL in Gnome Files

Dolphin (KDE)#

  1. Open file manager.
  2. Click on Network.
  3. In the address bar enter sftp://csnhr.nhr.fau.de or ssh://csnhr.nhr.fau.de and press ⏎ Enter.

Where to enter remote URL in Dolphin

Thunar (Xfce)#

  1. Open file manager.
  2. Press Ctrl + L, the focus is now in the Location Bar.
  3. Enter sftp://csnhr.nhr.fau.de or ssh://csnhr.nhr.fau.de and press ⏎ Enter.

Where to enter remote URL in Thunar

Linux console gio#

If your desktop environment/file manger uses gio/gvfs for remote connections you can use the gio utility to mount/unmount the remote locations with the following commands. The mounted locations will then appear in your file manager.

As <path> you can specify any remote path that is accessible to you.

  • mount:
    gio mount "sftp://csnhr.nhr.fau.de<path>"
    
  • unmount:
    gio mount -u "sftp://csnhr.nhr.fau.de<path>"
    
  • list mounts:
    gio mount --list --detail
    
  • information about mount point:
    gio info "sftp://csnhr.nhr.fau.de<path>"
    

gio mounted remote locations can also be used in the console. To find the mount point use gio info "sftp://csnhr.nhr.fau.de<path>" | grep "local path:". However, accessing this paths on the console might be slower than just using SSHFS.