Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
sshfs [2008/08/17 22:25] – angelegt gerald | sshfs [2024/02/29 13:36] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | z.B.: | ||
+ | < | ||
+ | sudo sshfs -C -p 22 -o uid=1000, | ||
+ | </ | ||
====== sshfs ====== | ====== sshfs ====== | ||
Quelle((http:// | Quelle((http:// | ||
+ | |||
+ | SSH is protocol to transfer files securely. Like FTP, but more secure. Many hosting services offer their client the ability to remotely login to their hosting account using ssh. Transferring files to an from an ssh account can be done using the scp command. However, it would be neat if you could mount a remote folder that you can access using ssh on your local computer, so that you can access files on an ssh | ||
+ | account just like they were local files on your pc, right? Well now you can! Mount a folder in an ssh account, edit the files locally and save the files, and the file on the ssh server changes too! Isn’t it awesome!!! | ||
+ | |||
+ | We will use sshfs to acheive our goal. The following guide will step you through the process of mouting file systems over ssh on Ubuntu 5.10 Breezy systems. | ||
+ | |||
+ | < | ||
+ | | ||
+ | Since most SSH servers already support this protocol it is very easy to | ||
+ | | ||
+ | side mounting the filesystem is as easy as logging into the server with | ||
+ | ssh. | ||
+ | </ | ||
+ | Install sshfs by doing a: | ||
+ | < | ||
+ | |||
+ | This will also install fuse-utils and libfuse2, which are required. | ||
+ | |||
+ | Now, let us create a local directory where you want the files mounted. You should create the directory and make yourself the owner of the directory: | ||
+ | |||
+ | < | ||
+ | $sudo chown your-username / | ||
+ | |||
+ | Where “dir-name” is the name of the directory on your local computer where you want to access the files from the remote computer. Say I want the files on the server to be available at / | ||
+ | |||
+ | Go to System-> | ||
+ | |||
+ | If you prefer to do it the easy way, on the commandline, | ||
+ | < | ||
+ | |||
+ | For security reasons, the / | ||
+ | |||
+ | Once you have done the above, you can use sshfs to mount the directory you need on the remote host to your local system! | ||
+ | |||
+ | For example, say I want to mount the “/ | ||
+ | < | ||
+ | |||
+ | Where “/ | ||
+ | |||
+ | Remember that the / | ||
+ | |||
+ | If you get the following error: | ||
+ | < | ||
+ | fusermount: fuse device not found, try ‘modprobe fuse’ first | ||
+ | </ | ||
+ | You will have to load the fuse module by doing: | ||
+ | < | ||
+ | |||
+ | You can add fuse to the modules that are loaded on startup by editing the file / | ||
+ | |||
+ | and then issue the sshfs command above again. | ||
+ | |||
+ | To unmount the directory once your work is done, use the command: | ||
+ | < | ||
+ | |||
+ | for example, in my case, I would use | ||
+ | < | ||
+ | |||
+ | ---- | ||
+ | |||
+ | Quelle((http:// | ||
+ | |||
+ | So kann man auf einem Debian-System Verzeichnisse anderer Server, zu denen man SSH-Zugriff hat, in das lokale Dateisystem einhängen. | ||
+ | |||
+ | Erst muß das erforderliche Paket installiert werden: | ||
+ | < | ||
+ | |||
+ | |||
+ | Ok, wenn das Paket installiert ist, muß nun das Kernel-Modul aktiviert werden: | ||
+ | < | ||
+ | |||
+ | Jetzt erstellen wir einen Mount-Point, | ||
+ | < | ||
+ | |||
+ | Jetzt hängen wir das Verzeichnis noch ein: | ||
+ | < | ||
+ | |||
+ | Der Beispiel-Befehl hängt das Verzeichnis /home/user des Servers/PCs 192.168.2.20 in das lokale Dateisystem / | ||
+ | |||
+ | Die am häufigsten benötigten Optionen: | ||
+ | |||
+ | Mit der Option -p 222 kann man statt dem Standard-Port 22 einen anderen verwenden | ||
+ | Mit der Option -o kann man für das gemountete Verzeichnis u.a. eine umask (z.B. umask=0777), | ||
+ | |||
+ | Ein komplettes Beispiel: | ||
+ | |||
+ | < | ||
+ | |||
+ | Für eine Liste aller Optionen, siehe sshfs --help | ||
+ | |||
+ | Wenn man auf die Eingabe des Passworts beim Einhängen verzichten will, empfiehlt es sich, so vorzugehen: [[www.cplinux.de/ | ||
+ | |||
+ | That's it. | ||
+ | |||
+ |