Falls noch nicht geschehen, sshfs installieren:
sudo apt update sudo apt install -y sshfs
Mountpoint anlegen:
sudo mkdir -p /mnt/storagebox
Falls der Public SSH Key noch nicht auf der Storage Box hinterlegt ist, muss das zuerst getan werden:
cat ~/.ssh/id_rsa.pub | ssh -p23 u254349-sub4@u254349-sub4.your-storagebox.de install-ssh-key
Einmalig verbinden
sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,IdentityFile=~/.ssh/id_rsa \ u254349-sub4@u254349-sub4.your-storagebox.de:/ /mnt/storagebox
Zum Aushängen kann man diesen Befehl benutzen:
fusermount -u /mnt/storagebox
oder
sudo umount /mnt/storagebox
Optional: Automount beim Boot
sudo nano /etc/systemd/system/mnt-storagebox.mount
Inhalt der Datei:
[Unit] Description=Hetzner Storage Box via SSHFS After=network-online.target Wants=network-online.target [Mount] What=u254349-sub4@u254349-sub4.your-storagebox.de:/ Where=/mnt/storagebox Type=fuse.sshfs Options=_netdev,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,IdentityFile=/root/.ssh/id_ed25519,allow_other,default_permissions TimeoutSec=30 [Install] WantedBy=multi-user.target
allow_other aktivieren:
echo "user_allow_other" | sudo tee -a /etc/fuse.conf
Aktivieren
sudo systemctl daemon-reload sudo systemctl enable --now mnt-storagebox.mount
Prüfen
systemctl status mnt-storagebox.mount
