Data Transfer/SSHFS: Difference between revisions

From bwHPC Wiki
Jump to navigation Jump to search
(created page)
 
m (fixed link)
 
Line 1: Line 1:
Sshfs is a network protocol for mounting data. It uses [[DataTransfer/SFTP|sftp]] under the hood.
Sshfs is a network protocol for mounting data. It uses [[Data Transfer/SFTP|sftp]] under the hood.


== Installation ==
== Installation ==

Latest revision as of 20:32, 21 November 2024

Sshfs is a network protocol for mounting data. It uses sftp under the hood.

Installation

For the necessary installations follow this link:
How to use SSHFS to Mount Remote Directories over SSH.
a) MacOS after the installation
To enable sshfs on your Mac go to: System Preferences -> General tab -> Allow Extensions button
Then follow the instructions that pop up (make sure that you remember the instructions before shutting down your computer).
b) Linux installation short commands

  • Debian/Ubuntu: apt-get install sshfs
  • CentOS/RedHat: yum install fuse-sshfs
  • If you want to use /etc/fstab, you can do this with the following entry:
    sshfs#<username>@<hostname>:    <your_local_mountpoint>   fuse   defaults,user,noauto,exec,reconnect        0       0 

Usage

Windows

  1. Go to "This PC" and select "Connect network drive" ("Netzlaufwerk verbinden")
  2. Select a drive (W:) and click on "connect with webpage on which you can save documents and images" (Verbindung mit website herstellen, auf der Sie Dokumente und Bilder speichern können)
  3. Enter the following as address, to connect to the home folder on the cluster:
    \sshfs\<username>@<hostname>/
    
    If you would want to go two folders up, you would add “../../” at the end.

MacOS & Linux

  1. Create an empty directory. The cluster/storage folder is going to be mounted to this directory.
  2. Mount a folder from the cluster/storage:
    # Home folder
    sshfs -o reconnect <username>@<hostname>: <localPath>
    # subfolderX
    sshfs -o reconnect <username>@<hostname>:subfolderX <localPath>
    

Undo mounting

MacOS & Linux:
If the connection to the cluster broke and you want to remount, you often have to use umount first. Try to remember to always unmount first before retrying. Otherwise it can happen that unmounting is not possible anymore by cmd. Usually the error message in this case tells you that the process is currently busy and therefore cannot umount. In this case, you have to restart the notebook which automatically unmounts everything.

```bash
umount -f <localPath>
# For example
umount -f /Users/<username>/Documents/mounted
# or use
fusermount -u <localPath>
```

Alternative tools using sshfs

We've described the most common way of using sshfs. Alternatively, you could use one of the following tools.

Tools to mount a Network Drive Windows Mac Linux
WebDrive (additionally for iOS, Android)
SFTPNetDrive
NetDrive
ExpanDrive