Rechner per sshfs einbinden: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 8: | Zeile 8: | ||
'''Erstellen eines Scripts zur Verbindung:''' | '''Erstellen eines Scripts zur Verbindung:''' | ||
<pre style="white-space: pre-wrap; | |||
white-space: -moz-pre-wrap; | |||
white-space: -pre-wrap; | |||
white-space: -o-pre-wrap; | |||
word-wrap: break-word;"> | |||
sudo touch mount_backup | |||
chmod a+x mount_backup | |||
<pre> | |||
In ''mount_backup'' folgenden Text hinzufügen: | |||
<pre style="white-space: pre-wrap; | <pre style="white-space: pre-wrap; | ||
Zeile 21: | Zeile 32: | ||
mount) | mount) | ||
echo "Mount 10.0.0.101:/media/backup/webserver/ into /<Pfad/zum/Einbindeverzeichnis>" | echo "Mount 10.0.0.101:/media/backup/webserver/ into /<Pfad/zum/Einbindeverzeichnis>" | ||
sudo sshfs <user>@10.0.0.101:/<pfad/auf/dem/Server> / | sudo sshfs <user>@10.0.0.101:/<pfad/auf/dem/Server> /<Pfad/zum/Einbindeverzeichnis> | ||
;; | ;; | ||
unmount) | unmount) | ||
Zeile 27: | Zeile 38: | ||
;; | ;; | ||
*) | *) | ||
echo "Usage: /bin/ | echo "Usage: /bin/mount_backup {mount|umount}" | ||
exit 1 | exit 1 | ||
;; | ;; | ||
Zeile 34: | Zeile 45: | ||
exit 0 | exit 0 | ||
</pre> | </pre> | ||
'''Aufruf:''' | |||
Mounten: <code>sudo /bin/mount_backup mount</code> | |||
Unmounten: <code>sudo /bin/mount_backup unmount</code> |
Version vom 5. März 2016, 10:52 Uhr
sudo apt-get install sshfs
Benutzer, der sshfs aufruf, zu der Gruppe fuse hinzufügen:
sudo usermod -aG fuse <user name>
Erstellen eines Scripts zur Verbindung:
sudo touch mount_backup chmod a+x mount_backup <pre> In ''mount_backup'' folgenden Text hinzufügen: <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"> #!/bin/sh # /bin/mount_backup case "$1" in mount) echo "Mount 10.0.0.101:/media/backup/webserver/ into /<Pfad/zum/Einbindeverzeichnis>" sudo sshfs <user>@10.0.0.101:/<pfad/auf/dem/Server> /<Pfad/zum/Einbindeverzeichnis> ;; unmount) fusermount -u /<Pfad/zum/Einbindeverzeichnis> ;; *) echo "Usage: /bin/mount_backup {mount|umount}" exit 1 ;; esac exit 0
Aufruf:
Mounten: sudo /bin/mount_backup mount
Unmounten: sudo /bin/mount_backup unmount