====== sshfs ======
* [[::SSH / SSL]]
* [[::SSH-Schlüssel austauschen für ein passwortlosen Login]]
* ''ssh-keygen -t ed25519 -a 1024''
[[http://stefankonarski.de/content/verschluesseltes-netzwerkdateisystem-sshfs-unter-freebsd]]
Damit auch unpreveligierte Benutzer mounten dürfen,
sind diese Änderungen nötig:
# echo vfs.usermount=1 >> /etc/sysctl.conf
# vi /etc/devfs.conf
...
perm /dev/acd0 0666
perm /dev/acd1 0666
perm /dev/cd0 0666
perm /dev/cd1 0666
# Allow all USB Devices to be mounted
perm /dev/da0 0666
perm /dev/da1 0666
perm /dev/da2 0666
perm /dev/da3 0666
perm /dev/da4 0666
# Misc other devices
perm /dev/pass0 0666
perm /dev/xpt0 0666
perm /dev/agpart 0666
perm /dev/uscanner0 0666
...
===== FreeBSD 9.0 =====
* [[http://forums.freebsd.org/showthread.php?t=11348]]
SSHFS installieren:
# portmaster sysutils/fusefs-sshfs
von Hand mounten:
/usr/local/bin/sshfs -o reconnect,uid=1001,gid=1000,allow_other fritz@server: /mnt
Eintrag in der ///etc/fstab// (Für einen passwortlosen Login, sollte aber bereits der SSH-Schlüssel ausgetauscht sein!):
mkdir -p /home/fritz/mnt/server
chown -R fritz /home/fritz/mnt
fritz@server: /home/fritz/mnt/server fuse.sshfs rw,mountprog=/usr/local/bin/sshfs,late,reconnect,uid=1002,gid=1000,allow_other 0 0
fratz@server: /home/fratz/mnt/server fuse.sshfs rw,mountprog=/usr/local/bin/sshfs,late,reconnect,idmap=user,allow_other 0 0
=== Eintrag in der /etc/fstab ===
fratz@server: /server/fritz fusefs.sshfs rw,mountprog=/usr/local/bin/sshfs,late,reconnect,umask=0002,uid=1000,gid=1000,allow_other 0 0
===== Debian 12.5 =====
==== AutoFS / AutoMount ====
root@debian:~# apt install autofs sshfs
root@debian:~# useradd -m mm
root@debian:~# id mm
uid=1001(mm) gid=1001(mm) groups=1001(mm)
root@debian:~# su - mm
mm@debian:~$ ssh-keygen -t ed25519 -a 1024
mm@debian:~$ cat ~/.ssh/id_ed25519.pub
//Dieser PUB-Key muß unter mm@192.168.0.1 abgelegt werden!//
mm@192.168.0.1:~$ vim /home/mm/.ssh/authorized_keys
...
/mm /etc/auto.sshfs -g -t 20 -uid=1001 -gid=1001
# SSHFS
Audio -fstype=fuse.sshfs,ro,allow_other,noatime,follow_symlinks,idmap=user,auto_cache,reconnect,ServerAliveInterval=15,Ciphers=aes128-ctr,Compression=no,IdentityFile=/home/mm/.ssh/id_ed25519 :sshfs\#mm@192.168.0.1\:/Audio
Video -fstype=fuse.sshfs,ro,allow_other,noatime,follow_symlinks,idmap=user,auto_cache,reconnect,ServerAliveInterval=15,Ciphers=aes128-ctr,Compression=no,IdentityFile=/home/mm/.ssh/id_ed25519 :sshfs\#mm@192.168.0.1\:/Video
root@debian:~# service autofs restart
root@debian:~# ls -lha /mm/
total 4.0K
drwxr-xr-x 4 root root 0 Mar 29 23:52 .
drwxr-xr-x 20 root root 4.0K Feb 21 01:55 ..
drwxr-xr-x 2 root root 0 Mar 29 23:52 Audio
drwxr-xr-x 2 root root 0 Mar 29 23:52 Video
root@debian:~# ls -lha /mm/Audio/
total 36M
drwxrwxr-x 1 mm mm 7 Sep 20 2023 .
drwxr-xr-x 4 root root 0 Mar 29 23:52 ..
drwxrwxr-x 1 mm mm 33 Jul 8 2023 Musik
===== Linux (Ubuntu) =====
Das ist ein tolles Programm, es funktioniert praktisch immer,
wenn ein SSHD auf dem Server (mars) läuft.
installieren:
# aptitude install scanssh sshfs
scannen:
# scanssh mars
192.168.0.2:22 SSH-2.0-OpenSSH_5.4p1 FreeBSD-20100308
Effective host scan rate: 6.33 hosts/s
wenn es im System mehrere NICs gibt, muss man eines angeben:
# scanssh -i bond2 mars
192.168.0.2:22 SSH-2.0-OpenSSH_5.4p1 FreeBSD-20100308
Effective host scan rate: 6.33 hosts/s
mount:
# echo "user_allow_other" >> /etc/fuse.conf
# sshfs fritz@mars: /mnt -o allow_other,sshfs_sync,follow_symlinks,idmap=user,auto_cache,reconnect,ServerAliveInterval=15,cache=yes,kernel_cache,Ciphers=aes128-ctr,Compression=no,IdentityFile=/home/frirtz/.ssh/id_ed25519
umount:
# fusermount -u /mnt
# umount /mnt
=== automatisches mounten der beim Systemstart ===
Mount-Point anlegen und Eintrag in der ///etc/fstab// (Für einen passwortlosen Login, sollte aber bereits der SSH-Schlüssel ausgetauscht sein!):
mkdir -p /server
echo "fritz@server: /server fuse.sshfs rw,user,umask=0002,uid=1000,gid=1000,allow_other 0 0" >> /etc/fstab
=== zusätzliche Laufwerke in Gnome (z.B. Nautilus) ===
Mount-Point im Home-Verzeichnis (//fritz// -> /home/fritz) anlegen:
mkdir -p ~/mnt/server
Eintrag in der ///etc/fstab// vornehmen (Für einen passwortlosen Login, sollte aber bereits der SSH-Schlüssel ausgetauscht sein!):
echo "fritz@server: /home/fritz/mnt/server fuse.sshfs rw,user,umask=0002,uid=1000,gid=1000,allow_other,noauto 0 0" >> /etc/fstab
===== Ubuntu 16.04 LTS =====
> aptitude install sshfs
> vi /etc/fstab
...
fritz@server.lan: /sshfs/fritz fuse.sshfs noauto,uid=1000,gid=1000,IdentityFile=/home/fritz/.ssh/id_ed25519,allow_other,_netdev 0 0
...
===== Windows 10 =====
Für sichere Dateitransfers zwischen Windows und Linux über SSH ist [[https://winscp.net/eng/docs/project_history|WinSCP]] eines der beliebtesten Tools. Die Bedienung erfolgt dort wie bei den meisten FTP-Clients, indem Dateien zwischen dem lokalen und entfernten Verzeichnisbaum bewegt werden. Noch eleganter ist unter Linux das Verwenden von SSHfs, ein FUSE-Modul (Filesystem in Userspace), mit dessen Hilfe sich entfernte Linux-Rechner via SSH in das lokale Dateisystem eines Linux-Clients einbinden lassen.
Den gleichen Zweck erfüllt unter Windows das freie SFTP-Tool **[[http://www.swish-sftp.org/|Swish]]**.
siehe auch: [[https://nelsonslog.wordpress.com/2017/07/19/windows-sshfs-clients/]]
Download:
* [[https://code.google.com/archive/p/win-sshfs/downloads|win-sshfs]]
* [[http://www.secfs.net/winfsp/|winfsp]]