Data Transfer/SSHFS: Difference between revisions
K Siegmund (talk | contribs) (remove harmful otp-incompatible reconnect flags) |
K Siegmund (talk | contribs) No edit summary |
||
| Line 15: | Line 15: | ||
== Usage == |
== Usage == |
||
=== Caveat: Unmounting === |
|||
Note that this creates a virtual drive on your system just as if you would plug in an external drive that stays active until you unmount it. Disk mounts happen on a low level of operating systems, so it is important to unmount the virtual drive cleanly whenever possible. |
|||
| ⚫ | |||
| ⚫ | 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. |
||
You should be able to find the process(es) that use the file system with <code>fuser -m <your_local_mountpoint></code> and kill/exit the processes that block unmounting or can kill them directly using <code>fuser -k -m <your_local_mountpoint></code> |
|||
In case this fails, you may have to restart your computer which automatically unmounts everything. |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
'''Windows''' |
|||
You should be able to click on the drive and choose "eject" or "unmount". If this is not the case, you can use |
|||
net use X: /delete |
|||
or if this does not work |
|||
taskkill /f /im sshfs.exe |
|||
(from: [https://stackoverflow.com/questions/62031900/how-to-unmount-close-the-mount-for-sshfs-windows stackoverflow]) |
|||
=== Windows === |
=== Windows === |
||
| Line 34: | Line 60: | ||
# subfolderX |
# subfolderX |
||
sshfs <username>@<hostname>:subfolderX <localPath></syntaxhighlight></li></ol> |
sshfs <username>@<hostname>:subfolderX <localPath></syntaxhighlight></li></ol> |
||
=== Undo mounting === |
|||
| ⚫ | |||
| ⚫ | 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. |
||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
Latest revision as of 16:26, 17 June 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 0 0
Usage
Caveat: Unmounting
Note that this creates a virtual drive on your system just as if you would plug in an external drive that stays active until you unmount it. Disk mounts happen on a low level of operating systems, so it is important to unmount the virtual drive cleanly whenever possible.
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.
You should be able to find the process(es) that use the file system with fuser -m <your_local_mountpoint> and kill/exit the processes that block unmounting or can kill them directly using fuser -k -m <your_local_mountpoint>
In case this fails, you may have to restart your computer which automatically unmounts everything.
bash umount -f <localPath> # For example umount -f /Users/<username>/Documents/mounted # or use fusermount -u <localPath>
Windows You should be able to click on the drive and choose "eject" or "unmount". If this is not the case, you can use
net use X: /delete
or if this does not work
taskkill /f /im sshfs.exe
(from: stackoverflow)
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 <username>@<hostname>: <localPath> # subfolderX sshfs <username>@<hostname>:subfolderX <localPath>