Data Transfer/SSHFS: Difference between revisions
H Schumacher (talk | contribs) m (Added warning for Windows sshfs with 2fa) |
H Schumacher (talk | contribs) m (Rclone link for 2fa cases.) |
||
| Line 17: | Line 17: | ||
=== Windows === |
=== Windows === |
||
''Caution: sshfs on Windows doesn't work with 2FA. |
''Caution: sshfs on Windows doesn't work with 2FA. An alternative is [[Data_Transfer/Rclone | Rclone with sftp]] + [[Registration/SSH | ssh key]].'' |
||
<ol style="list-style-type: decimal;"> |
<ol style="list-style-type: decimal;"> |
||
<li>Go to "This PC" and select "Connect network drive" ("Netzlaufwerk verbinden")</li> |
<li>Go to "This PC" and select "Connect network drive" ("Netzlaufwerk verbinden")</li> |
||
<li>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)</li> |
<li>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)</li> |
||
<li>Enter the following as address, to connect to the home |
<li>Enter the following as address, to connect to the home or root folder: |
||
<syntaxhighlight lang="bash">\sshfs\<username>@<hostname>/</syntaxhighlight> |
<syntaxhighlight lang="bash">\sshfs\<username>@<hostname>/</syntaxhighlight> |
||
If you would want to go two folders up, you would add “''../../''” at the end.</li></ol> |
If you would want to go two folders up, you would add “''../../''” at the end.</li></ol> |
||
Latest revision as of 16:10, 13 May 2026
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:
dnf 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
Caution: sshfs on Windows doesn't work with 2FA. An alternative is Rclone with sftp + ssh key.
- Go to "This PC" and select "Connect network drive" ("Netzlaufwerk verbinden")
- 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)
- Enter the following as address, to connect to the home or root folder:
If you would want to go two folders up, you would add “../../” at the end.
\sshfs\<username>@<hostname>/
MacOS & Linux
- Create an empty directory. The cluster/storage folder is going to be mounted to this directory.
- 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> ```