Skip to main content

SSHFS

Umgezogene User

Username
Backup SK
Crontab
Metric Status Info
Little-Snitch-5853-e818-c249-808

  Fertig Laptop MKP






V1_DHCP




V2_DHCP-Backup




V3_Pi-hole




V4_Pi-hole-Backup




V5_OpenVPN




V6_OpenVPN-Backup




V7_FileShare




V8_Webserver




V9_MQTT




V10_UniFi-Controller




V11_Sonos-Controller




V12_LowFileShare




V13_Philips_hue




V14_OpenHAB




V15_CMS




V16_DataDownload




V17_Tors-Site




V18_NTP




V21_WS




V22_IDC




V23_Datenbank




V24_NextCloud True True True Fertig
NextCloud
V25_Vaultwarden True
True
True Fertig
Vaultwarden
V26_Grafana




V28_WS4




V29_Kali-Linux




V30_OpenVPN-22




V34_VPN-Router




V36_InfluxDB True
True True
Fertig
InfluxDB
V40_Syslog




V41_IoT-Router




V42_Radicale




V43_Router




V44_Printserver




V46_Postfix




V47_MQTT-Extern




V48_FTP




V51_Gatekeeper




V52_BookStack True True True Fertig
BookStack
V53_Apache_Guacamole




V54_PXE-Boot




V56_ntfy




useradd -M -s /bin/bash -G sshfsusers OTTO_MÜLLER_123

🔐 SSHFS-Mount Anleitung für Linux + Nextcloud

1. SSH-Schlüssel erstellen (auf dem Client)

ssh-keygen -t ed25519 -f ~/.ssh/V24_NextCloud -C "V24_NextCloud on ThinkStation__S4AKHKX__big-bunda"
ssh-keygen -t ed25519 -f /root/.ssh/ -C " on ThinkStation__S4AKHKX__big-bunda"

2. Öffentlichen Schlüssel auf den Server übertragen

scp ~/.ssh/V24_NextCloud.pub root@server:/etc/sshfs_keys/V24_NextCloud.pub
chmod 644 /etc/sshfs_keys/V24_NextCloud.pub

3. Benutzer auf dem Server anlegen (sicher für SSHFS)

useradd -M -s /bin/bash -G sshfsusers V24_NextCloud
mkdir -p /mnt/sshfs/V24_NextCloud
chown V24_NextCloud:V24_NextCloud /mnt/sshfs/V24_NextCloud

# Optionale Dummy-Shell für mehr Sicherheit:
echo -e '#!/bin/bash\nexit 0' > /usr/local/bin/sshfs-dummy
chmod +x /usr/local/bin/sshfs-dummy
usermod -s /usr/local/bin/sshfs-dummy V24_NextCloud

4. SSH-Konfiguration (angepasst für SSHFS)

# /etc/ssh/sshd_config
Match User V24_NextCloud
    AuthorizedKeysFile /etc/sshfs_keys/%u.pub
    AllowTcpForwarding no
    X11Forwarding no
    PermitTTY yes
    # Kein ForceCommand setzen, da SSHFS sonst blockiert würde
systemctl reload sshd

5. SSHFS-Mount auf dem Client

sshfs -o IdentityFile=~/.ssh/V24_NextCloud \
      -o reconnect \
      -o ServerAliveInterval=15 \
      -o ServerAliveCountMax=3 \
      -o allow_other \
      -o uid=1000 \
      -o gid=1000 \
      -o umask=002 \
      -o idmap=user \
      V24_NextCloud@server:/mnt/sshfs/V24_NextCloud /mnt/V24_NextCloud

💡 Hinweis:

  • /etc/fuse.conf: Stelle sicher, dass user_allow_other nicht auskommentiert ist
  • uid und gid auf deinen lokalen User anpassen (z. B. id benutzername)
  • Mit umask=002 erhält Gruppe vollen Zugriff (770)

🎁 Bonus: Nutzung mit Nextcloud

Mount für www-data (Nextcloud)

sshfs -o IdentityFile=~/.ssh/nextcloud_key \
      -o reconnect \
      -o ServerAliveInterval=15 \
      -o ServerAliveCountMax=3 \
      -o allow_other \
      -o uid=33 \
      -o gid=33 \
      -o umask=007 \
      -o idmap=user \
      nextcloud@server:/mnt/sshfs/nextcloud /mnt/nextcloud_data

Wichtig:

  • uid=33 und gid=33 = Benutzer www-data (standardmäßig)
  • Pfad /mnt/nextcloud_data muss für Nextcloud erreichbar sein
  • In Nextcloud → Admin → Externer Speicher hinzufügen

Optional für Dauerbetrieb:

Systemd-Mount oder /etc/fstab verwenden, z. B.:

sshfs#nextcloud@server:/mnt/sshfs/nextcloud /mnt/nextcloud_data fuse.sshfs \
IdentityFile=/root/.ssh/nextcloud_key,allow_other,uid=33,gid=33,umask=007,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,idmap=user 0 0

🙋‍♂️ Hilfe für Mehrbenutzer-Zugriff unter Linux

  • Verwende -o allow_other, um auch anderen lokalen Usern Zugriff zu erlauben
  • Nutze uid= und gid=, um das Mount für bestimmte Benutzer oder Gruppen bereitzustellen
  • Beispiel für Gruppe medien:
    -o allow_other,uid=1000,gid=1002,umask=007
  • Tipp: Passe Gruppenrechte lokal an, z. B. mit usermod -aG medien benutzername