SSHFS
Umgezogene User
Username |
Backup SK |
Crontab |
Status | Info |
Little-Snitch-5853-e818-c249-808 | Fertig | Laptop MKP |
||
V24_NextCloud | Fertig |
NextCloud |
||
V25_Vaultwarden | True |
True |
Fertig |
Vaultwarden |
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"
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 (falls nötig)
useradd -M -s /bin/bash -G sshfsusers V24_NextCloud
mkdir -p /mnt/sshfs/V24_NextCloud
chown V24_NextCloud:V24_NextCloud /mnt/sshfs/V24_NextCloud
4. SSH-Konfiguration (Server)
# /etc/ssh/sshd_config
Match Group sshfsusers
AuthorizedKeysFile /etc/sshfs_keys/%u.pub
AllowTcpForwarding no
X11Forwarding no
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, dassuser_allow_other
nicht auskommentiert istuid
undgid
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=
undgid=
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